image thumbnail

Average mutual information

version (1.1 KB) by Aslak Grinsted
Average mutual information


Updated 17 Feb 2006

No License

Very fast implementation of average mutual information.

Usage: [v,lag]=ami(x,y,lag)

Calculates the mutual average information of x and y with a possible lag.

v is the average mutual information. (relative units see below)
x & y is the time series. (column vectors)
lag is a vector of time lags.

(A peak in V for lag>0 means y is leading x.)

v is given as how many bits x and y has in common relative to how
many bits is needed for the internally binned representation of x or y.
This is done to make the result close to independent bin size.

For optimal binning: transform x and y into percentiles prior to running
ami. See boxpdf at matlab central.

Aslak Grinsted feb2006
(Inspired by mai.m by Alexandros Leontitsis)

Cite As

Aslak Grinsted (2022). Average mutual information (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: Mutual Average Information

Community Treasure Hunt

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

Start Hunting!