Description Usage Arguments Value Examples
Compute the average or the local mutual information between two or more time series. Each variable can have a different base.
1 | mutual_info(series, local = FALSE)
|
series |
Matrix specifying a set of time series. |
local |
Boolean specifying whether to compute the local mutual information. |
Numeric giving the average mutual information or a vector giving the local mutual information.
1 2 3 4 5 6 7 8 9 | series <- matrix(0, nrow = 20, ncol = 2)
series[, 1] <- c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1)
series[, 2] <- c(0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1)
mutual_info(series) # 0.2141709
# [1] -1.0, -1.0, 0.2223924, 0.2223924, 0.2223924, 0.2223924, 0.2223924,
# 0.2223924, 0.2223924, 0.2223924, 0.2223924, 0.2223924, 0.2223924, 0.2223922,
# 0.2223924, 0.2223924, 1.5849625, 1.5849625, 1.5849625, -1.5849625
mutual_info(series, local = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.