The fundamental problem for data mining and statistical analysis is:

- Whether two random variables are dependent?

**fastmit** package provides solutions for this issue.
It implements the kNN method described by Kraskov, et. al (2004) to
estimate the empirical mutual information and furthermore uses
permutation test to detect whether two random variables are independent.
The core functions in **fastmit** package are
**mi** and **mi.test**.

These functions based on mutual information have two main advantages:

It’s applicable to complex data in metric spaces.

It is faster than other statistics (e.g., distance covariance and ball covariance), which makes it advantageous in large sample situations.

You can install the released version of fastmit from CRAN with:

`install.packages("fastmit")`

You can install the released version of fastmit from GitHub with:

```
library(devtools)
install_github("Mamba413/fastmit/R-package")
```

*Windows* user will need to install Rtools
first.

**mi**function

```
## simulate data
set.seed(1)
<- rnorm(100)
x <- x + rnorm(100)
y ## estimate the empirical mutual information
mi(x, y)
```

In this example, the result is:

`# [1] 0.3320034`

**mi.test**function

```
## simulate data
set.seed(1)
<- runif(50, min = -0.3, max = 0.3)
error <- runif(50, 0, 4*pi)
x <- cos(x) + error
y
## perform independence test via mutual information
mi.test(x, y)
```

In this example, the result is:

```
Mutual Information test of independence
data: x and y
number of observations = 50
replicates = 99
p-value = 0.01
alternative hypothesis: random variables are dependent
sample estimates:
MI
0.6953105
```

If you find any bugs, or if you experience any crashes, please report to us. Also, if you have any questions, feel free to ask.

GPL-3

- Alexander Kraskov; Harald Stögbauer; Peter Grassberger Phys. Estimating Mutual Information Rev. E 69, 066138