covariate_memory {mixvlmc}R Documentation

Covariate memory length for a COVLMC context

Description

This function returns the length of the memory of a COVLMC context represented by a ctx_node_covlmc object.

Usage

covariate_memory(node)

Arguments

node

A ctx_node_covlmc object as returned by find_sequence() or contexts.covlmc()

Value

the memory length, an integer

Examples

pc <- powerconsumption[powerconsumption$week == 5, ]
dts <- cut(pc$active_power, breaks = c(0, quantile(pc$active_power, probs = c(0.5, 1))))
dts_cov <- data.frame(day_night = (pc$hour >= 7 & pc$hour <= 17))
m_cov <- covlmc(dts, dts_cov, min_size = 10)
ctxs <- contexts(m_cov)
## get all the memory lengths
sapply(ctxs, covariate_memory)

[Package mixvlmc version 0.2.1 Index]