dit / dit

Python package for information theory.
http://docs.dit.io
BSD 3-Clause "New" or "Revised" License
506 stars 87 forks source link

ask some questions #181

Closed OrdinarySK closed 3 years ago

OrdinarySK commented 3 years ago

Hello, I want to calculate multivariate joint entropies about 80 sites which contains three parameter. My sample data is follow:

precipitation lst soilmoisture
228 12.8923 8.04612
245 12.1109 6.95139
281 11.2158 10.6917
225 5.90652 7.37776
262 6.30347 9.76893
361 8.00681 9.26292
606 14.35 11.7481
231 4.61978 4.34707
510 10.8987 7.08284

One row is a site, I need to calculate multivariate sites's joint entropies. Can I use the package. Could you tell me how to use this package to calculate the values. If not, Could you give me some suggestions to solve the problem. Thank you.

Autoplectic commented 3 years ago

I believe dit can compute what you're interested in. Given these samples, you can use dit.inference.differential_entropy_knn to estimate the differential entropy of any subset of columns. Something along the lines of:

differential_entropy_knn(data=df.values, rvs=[0, 1, 2])

to calculate the entropy of the joint variable (precipitation, lst, soilmoisture).