Skip to content

Commit

Permalink
Add tests for multivariate MI (#74)
Browse files Browse the repository at this point in the history
* Add tests for multivariate MI

* Add estimator to tests
  • Loading branch information
kahaaga authored Sep 28, 2021
1 parent a4176d6 commit e1106b1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ BruteForce = Entropies.BruteForce
est = VisitationFrequency(RectangularBinning(0.2))
@test mutualinfo(x, y, est) isa Real
@test mutualinfo(x, y, est, q = 2) isa Real
@test mutualinfo(x, z, est) isa Real
@test mutualinfo(z, x, est) isa Real
@test mutualinfo(z, w, est) isa Real

# Estimators for which Renyi entropies cannot be used
est_kl = KozachenkoLeonenko()
Expand All @@ -26,15 +29,27 @@ BruteForce = Entropies.BruteForce

@test mutualinfo(x, y, est_kl) isa Real
@test mutualinfo(x, y, est_kl, base = 2) isa Real
@test mutualinfo(x, z, est_kl) isa Real
@test mutualinfo(z, x, est_kl) isa Real
@test mutualinfo(z, w, est_kl) isa Real

@test mutualinfo(x, y, est_k) isa Real
@test mutualinfo(x, y, est_k, base = 2) isa Real
@test mutualinfo(x, z, est_k) isa Real
@test mutualinfo(z, x, est_k) isa Real
@test mutualinfo(z, w, est_k) isa Real

@test mutualinfo(x, y, est_k1) isa Real
@test mutualinfo(x, y, est_k1, base = 2) isa Real
@test mutualinfo(x, z, est_k1) isa Real
@test mutualinfo(z, x, est_k1) isa Real
@test mutualinfo(z, w, est_k1) isa Real

@test mutualinfo(x, y, est_k2) isa Real
@test mutualinfo(x, y, est_k2, base = 2) isa Real
@test mutualinfo(x, z, est_k2) isa Real
@test mutualinfo(z, x, est_k2) isa Real
@test mutualinfo(z, w, est_k2) isa Real
end

@testset "Transfer entropy" begin
Expand Down

0 comments on commit e1106b1

Please sign in to comment.