
Mutual information by k-nearest-neighbour statistics (KSG)
Source:R/miest1_native.R
morie_miest1.RdJoint space uses the maximum norm (Eq. 6). Algorithm 1 (Eq. 8): I = psi(k) - <psi(nx+1) + psi(ny+1)> + psi(N), counting points with projected distance strictly less than the k-th joint neighbour distance. Algorithm 2 (Eq. 9): I = psi(k) - 1/k - <psi(nx) + psi(ny)> + psi(N), counting points inside the smallest rectangle holding the k joint neighbours. Both are provided; algorithm 1 is the default (the paper reports smaller statistical error for it at equal k). Units are nats.
References
Kraskov, A., Stogbauer, H. and Grassberger, P. (2004). Estimating mutual information. Physical Review E, 69, 066138.
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_miest1(V, V)
#> $mi
#> [1] 1.092857
#>
#> $mi_bits
#> [1] 1.57666
#>
#> $k
#> [1] 3
#>
#> $algorithm
#> [1] 1
#>
#> $n
#> [1] 8
#>
#> $method
#> [1] "KSG mutual information, Eq. 8 (Kraskov 2004)"
#>