make_block: Make a lagged block for multiview

Description Usage Arguments Value Examples

View source: R/data_transformations.R

Description

make_block generates a lagged block with the appropriate max_lag and tau, while respecting lib (by inserting NANs, when trying to lag past lib regions)

Usage

1
2
make_block(block, t = NULL, max_lag = 3, tau = 1, lib = NULL,
  restrict_to_lib = TRUE)

Arguments

block

a data.frame or matrix where each column is a time series

t

the time index for the block

max_lag

the total number of lags to include for each variable. So if max_lag == 3, a variable X will appear with lags X[t], X[t - tau], X[t - 2*tau]

tau

the lag to use for time delay embedding

lib

a 2-column matrix (or 2-element vector) where each row specifies the first and last *rows* of the time series to use for attractor reconstruction

restrict_to_lib

whether to restrict the final lagged block to just the rows specified in lib (if lib exists)

Value

A data.frame with the lagged columns and a time column. If the original block had columns X, Y, Z and max_lag = 3, then the returned data.frame will have columns TIME, X, X_1, X_2, Y, Y_1, Y_2, Z, Z_1, Z_2.

Examples

1
2
data("block_3sp")
make_block(block_3sp[, c(2, 5, 8)])

ha0ye/rEDM documentation built on March 30, 2021, 11:21 p.m.