Learn R Programming

mixvlmc (version 0.2.1)

context_number.covlmc: Contexts number of a VLMC with covariates

Description

This function returns the total number of contexts of a VLMC with covariates.

Usage

# S3 method for covlmc
context_number(ct)

Value

the number of contexts present in the VLMC with covariates.

Arguments

ct

a fitted covlmc model.

Examples

Run this code
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)
# should be 3
context_number(m_cov)

Run the code above in your browser using DataLab