binByMemory: Bin rows in a matrix by memory.

View source: R/binByMemory.R

binByMemoryR Documentation

Bin rows in a matrix by memory.

Description

Memory is assessed either with the Hurst exponent or with the maximum auto- correlation (omitting lag zero). Hurst exponents are computed with function hurstexp in package pracma. The simple R/S Hurst exponent is selected.

Usage

binByMemory(x, thresholds = c(0.3, 0.5, 0.8), method = "autocor",
  d = round(ncol(x)/3))

Arguments

x

a matrix with objects as rows and time points as columns

thresholds

the thresholds by which to bin

method

autocor or hurst, computing the maximum auto-correlation (omitting lag=0) and the Hurst exponent, respectively

d

window size for Hurst exponent computation with function hurstexp

Details

The function returns an object that groups matrix row indices in different levels. Rows that could not be binned are classified in bin na.

Value

list with row indices assigned to bins

Examples

N=10
ricker.out=ricker(N,generateA(N),K=rep(0.01,N))
memBinned=binByMemory(ricker.out)
memBinned.bars=c(length(memBinned$autocor0.8Inf),length(memBinned$autocor0.50.8))
names(memBinned.bars)=names(memBinned)
barplot(memBinned.bars,main="Auto-correlation bins", ylab="Number of rows")

hallucigenia-sparsa/seqtime documentation built on Jan. 9, 2023, 11:53 p.m.