GithubHelp home page GithubHelp logo

knnie's People

Contributors

wgao9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

knnie's Issues

Underestimated Mutual Information

Hello, thank you for the KSG estimator implementation. I ran the estimator for a high-dimensional normal distribution as follows:

SIZE = 32
HALF_SIZE = int(SIZE / 2)
cov = np.eye(SIZE)
cov[:HALF_SIZE, HALF_SIZE:] = 0.5 * np.eye(HALF_SIZE)
cov[HALF_SIZE:, :HALF_SIZE] = 0.5 * np.eye(HALF_SIZE)

print("True:", 0.5 * log(1 / np.linalg.det(cov)))

points = np.random.multivariate_normal(np.zeros(SIZE), cov, size=5000)
X, Y = points[:, :HALF_SIZE], points[:, HALF_SIZE:]

print("Estimated:", kraskov_mi(X, Y, k=5))

The result was

True: 2.3014565796142468
Estimated: 0.7142441789816445

This result is consistent over multiple random samples. Can you provide any intuition on why the estimated mutual information is substantially lower than the true mutual information? Is the estimate normalized in some way I'm not seeing?

I'm using the natural logarithm, which was also used in the kraskov_mi estimator. I'm computing the true MI using the formula here.

Any help is appreciated ๐Ÿ˜„.

Demo does not provide sensible results

Problem

Thank you for your implementation of the seminal 2004 paper. Your code is pretty neat and well-documented, together with your 2016 contribution to the original paper.

However, when I tried to run your demo, I encountered some incorrect results, where the mutual information should have been non-negative (even not they are negative from a not very large margin from 0).

I(X;Y) =  -0.0004731760591245582
I(X;Y) =  -0.00016452501890240612
I(X;Y;Z) =  0.009085351036950406
I(X;Y;Z) =  0.013315288591181584

I am not sure whether this is the limitation of the originally proposed method. Further, is there any way to remedy this incorrectness?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.