Git Product home page Git Product logo

gcmi's People

Contributors

dizcza avatar lukassnoek avatar robince 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gcmi's Issues

LinAlgError: Matrix is not positive definite

Hello Dr. Robin Ince,

I was using you gcmi code to measure information between two signals with 39 and 300 dimension. but i have enconterd an error in the cholsky decomposition. it says that matrix is no positive definite. I understood that its a problem of my input matrix because its eigen values include negative values. I have tried to modified the eigen values replacing negative values with zeros and then recomposing the original matrix. but still i get the same error. I just want to ask you did you ever encounter this type of problem?

my error


LinAlgError Traceback (most recent call last)
in
----> 1 chCxy = np.linalg.cholesky(Cxy)

~\Anaconda3\lib\site-packages\numpy\linalg\linalg.py in cholesky(a)
731 t, result_t = _commonType(a)
732 signature = 'D->D' if isComplexType(t) else 'd->d'
--> 733 r = gufunc(a, signature=signature, extobj=extobj)
734 return wrap(r.astype(result_t, copy=False))
735

~\Anaconda3\lib\site-packages\numpy\linalg\linalg.py in _raise_linalgerror_nonposdef(err, flag)
90
91 def _raise_linalgerror_nonposdef(err, flag):
---> 92 raise LinAlgError("Matrix is not positive definite")
93
94 def _raise_linalgerror_eigenvalues_nonconvergence(err, flag):

LinAlgError: Matrix is not positive definite

GCMI in Python gives unexpected results

Hi @robince, I just stumbled on your work and it's super interesting! I see we have somewhat related interests in complexity metrics ☺️

We recently implemented quite a lot of complexity algos in neurokit, and we also have a function to compute Mutual Info using different types of methods. I myself am not an expert at all of this, but I managed to adapt & implement some of these methods so that they are easy to use.

I think it'd be great to add GC MI, and I gave it a quick try by using your code, but unfortunately the results are somewhat unexpected. I computed the MI of two small series under different conditions of noise, using "traditional" approaches and GCMI (MI6 in the plot), but the pattern doesn't look like the others...

image

Am I missing something? Or misunderstanding how to use this function?

The code to reproduce the fig is in this PR neuropsychology/NeuroKit#677 (& here's the link to the adaptation (mostly streamlining) of your code: https://github.com/neuropsychology/NeuroKit/pull/677/files)

let me know what you think! cheers

mutual information for donut-shaped distribution

Thanks for making this method for mutual information estimation available. I have done a quick test in matlab (and python) on a donut-shaped bivariate distribution for which I would expect the mutual information to be non-zero. However the result that gcmi_cc gives is very close to zero.

Is this an expected result, or do I use the functions incorrectly?

Here is the matlab code for the test:

t=(1:1999)'/200.;
s1 = normrnd(1.,0.1,[2000,1]) * sin( 2*pi*t );
s2 = normrnd(1.,0.1,[2000,1]) * sin( 2*pi*t - 0.5*pi );
gcmi_cc( s1, s2 ) % gives as answer: -3.5968e-04

Pz for gcmi_ccd (Python)

Hi !

Thank you a lot for this nice code. I think there's a mistake for the Python version of the gcmi_ccd. Pz should be the sum of idx (and not x.shape) :

Pz[zi] = idx.sum()  # or thsx.shape[-1]

Pypi distribution?

Among the other mutual information estimators, your one looks promising. Are you willing to ship your python implementation to pypi? I'd like to use your package (that hopefully will be updated) instead of just copying the source code.
Thank you.

Softmax test overestimated

Dear Robin,

I find your mutual information estimator practically useful for continuos-continuos typical data. But it overestimates the mutual information if the data does not follow Gaussian distribution. Is your estimator supposed to work with Gaussian only distributed data?

I can describe in details my test but it makes sense if your estimator accepts non-gaussian.

Cheers,
Danylo.

Erroneous results?

Hi,

I am using Python 3.6.5 on a windows machine. I generate 2D data sets: linear and nonlinear distributions, following the Python code at https://minepy.readthedocs.io/en/latest/python.html

By the way, these distributions are shown in the paper "A statistical framework for neuroimaging data analysis based on mutual information estimated via a gaussian copula"

Then, I created my script to compute GCMI and got these results:
a) 7 linear distributions:
26.4952
0.7085
0.1584
0.0015
0.1033
0.7295
10.5505

I would expect that the first and last to have a GCMI of 1 - assuming 1 is the highest value meaning a perfect dependence

b) 7 nonlinear distributions:
-0.0004
-0.0001
-0.0003
-0.0003
0.0004
0.0022
-0.0003

What is the meaning of negative correlation values? why are these values so low?

I attached to this issue: my script and input data.

Many thanks,

Ivan

Python_GCMI_2D_Synthetic_Data.zip

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.