Cut off value for pruning a node in the context tree of a VLMC
Source:R/ctx_node_vlmc.R
cutoff.ctx_node.RdThis function returns the cut off value associated to a specific node in the
context tree interpreted as a VLMC. The node is represented by a ctx_node
object as returned by find_sequence() or contexts(). For details, see
cutoff.vlmc().
Arguments
- model
a
ctx_nodeobject as returned byfind_sequence()- scale
specify whether the results should be "native" log likelihood ratio values or expressed in a "quantile" scale of a chi-squared distribution (defaults to "quantile").
- raw
specify whether the returned values should be limit values computed in the model or modified values that guarantee pruning (see details in
cutoff.vlmc())- ...
additional arguments for the
cutofffunction.
Examples
pc <- powerconsumption[powerconsumption$week == 5, ]
dts <- cut(pc$active_power, breaks = c(0, quantile(pc$active_power, probs = c(0.25, 0.5, 0.75, 1))))
model <- vlmc(dts)
model_ctxs <- contexts(model)
cutoff(model_ctxs[[1]])
#> [1] 0.01049483
cutoff(model_ctxs[[2]], scale = "native", raw = TRUE)
#> [1] 0.4758802