Learn R Programming

mixvlmc (version 0.2.1)

is_merged: Merging status of a COVLMC context

Description

The function returns TRUE if the context represented by this node is merged with at least another one and FALSE if this is not the case.

Usage

is_merged(node)

Value

TRUE or FALSE, depending on the nature of the context

Arguments

node

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

Details

When a COVLMC is built on a time series with at least three distinct states, some contexts can be merged: they use the same logistic model, leading to a more parsimonious model. Those contexts are reported individually by functions such as contexts.covlmc(). The present function can be used to detect such merging, while merged_with() can be used to recover the other contexts.

See Also

merged_with()

Examples

Run this code
pc <- powerconsumption[powerconsumption$week == 15, ]
dts <- cut(pc$active_power, breaks = c(0, 1, 2, 3, 8))
dts_cov <- data.frame(day_night = (pc$hour >= 7 & pc$hour <= 17))
m_cov <- covlmc(dts, dts_cov, min_size = 5, alpha = 0.1)
ctxs <- contexts(m_cov)
## no merging
sapply(ctxs, is_merged)

Run the code above in your browser using DataLab