mif | R Documentation |
Calculate the lagged mutual information fucntion within (auto-mif) or between (cross-mif) time series, or, conditional on another time series (conditional-cross-mif). Alternatively, calculate the total information of a multivariate dataset for different lags.
mif(
y,
lags = -10:10,
nbins = ceiling(2 * NROW(y)^(1/3)),
doPlot = FALSE,
surTest = FALSE,
alpha = 0.05
)
y |
A |
lags |
The lags to evaluate mutual information. |
nbins |
The number of bins passed to |
doPlot |
Produce a plot of the symbolic time series by calling |
surTest |
If |
alpha |
The alpha level for the surrogate test (default = |
The auto- or cross-mi function
Other Redundancy measures (mutual information):
mi_interlayer()
,
mi_mat()
# Lags to evaluate mututal information
lags <- -10:30
# Auto-mutual information
y1 <- sin(seq(0, 100, by = 1/8)*pi)
(mif(data.frame(y1),lags = lags))
# Cross-mututal information, y2 is a lagged version y1
y2 <- y1[10:801]
y <- data.frame(ts_trimfill(y1, y2, action = "trim.cut"))
(mif(y,lags = lags))
# Conditional mutual information, add some noise to y2 and add it as a 3rd column
y$s <- y2+rnorm(NROW(y2))
(mif(y,lags = lags))
# Multi-information, the information of the entire multivariate series at each lag
y$y3 <- cumsum(rnorm(NROW(y)))
(mif(y,lags = lags))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.