mutual_info: Mutual Information

Description Usage Arguments Value Examples

View source: R/mutualinfo.R

Description

Compute the average or the local mutual information between two or more time series. Each variable can have a different base.

Usage

1
mutual_info(series, local = FALSE)

Arguments

series

Matrix specifying a set of time series.

local

Boolean specifying whether to compute the local mutual information.

Value

Numeric giving the average mutual information or a vector giving the local mutual information.

Examples

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)

rinform documentation built on April 1, 2018, 12:12 p.m.