Learn R Programming

rinform (version 1.0.2)

predictive_info: Predictive Information

Description

Compute the predictive information from a time series with history length kpast and future length kfuture.

Usage

predictive_info(series, kpast, kfuture, local = FALSE)

Arguments

series

Vector or matrix specifying one or more time series.

kpast

Integer giving the history length.

kfuture

Integer giving the future length.

local

Boolean specifying whether to compute the local predictive information.

Value

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

Examples

Run this code
# NOT RUN {
# One initial condition
xs <- c(0, 0, 1, 1, 0, 0, 1, 1, 0)
predictive_info(xs, kpast = 1, kfuture = 2) # 0.985228

# [0.807, 0.807, 1.222, 1.222, 0.807, 0.807, 1.222]
predictive_info(xs, kpast = 1, kfuture = 2, local = TRUE)

# Multiple initial conditions
xs      <- matrix(0, nrow = 9, ncol = 2)
xs[, 1] <- c(0, 0, 1, 1, 0, 0, 1, 1, 0)
xs[, 2] <- c(0, 1, 0, 1, 0, 1, 0, 1, 0)
predictive_info(xs, kpast = 1, kfuture = 2) # 0.244905

# [, 1] -0.515 0.807 -0.363 1.222 -0.515 0.807 -0.363
# [, 2] 0.222 0.485  0.222 0.485  0.222 0.485  0.222
predictive_info(xs, kpast = 1, kfuture = 2, local = TRUE)

# }

Run the code above in your browser using DataLab