File Exchange

image thumbnail

Entropy estimation by Kozachenko-Leonenko method

version 2.0.0.0 (1.3 KB) by Martin V.
The script calculates the entropy point estimation for 1D date by the Kozachenko-Leonenko method.

1 Download

Updated 28 Aug 2018

View Version History

View License

The script calculates the entropy point estimation for 1D date by the Kozachenko-Leonenko method.

Cite As

Martin V. (2021). Entropy estimation by Kozachenko-Leonenko method (https://www.mathworks.com/matlabcentral/fileexchange/37370-entropy-estimation-by-kozachenko-leonenko-method), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

LionelB

Hi Martin, nice code.

A suggestion for better efficiency on large samples is to vectorise the loop

for k = 2:n-1
r(k) = min([input(k+1) - input(k),input(k) - input(k-1)]);
end

as
r(2:n-1) = min([input(3:n)-input(2:n-1); input(2:n-1)-input(1:n-2)]);

(Note: this assumes 'input' is a row vector.)

NoNa

MATLAB Release Compatibility
Created with R2017b
Compatible with R2010a and later releases
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!