as_vlmc.ctx_tree_cpp {mixvlmc}R Documentation

Convert an object to a Variable Length Markov Chain (VLMC)

Description

This generic function converts an object into a vlmc.

Usage

## S3 method for class 'ctx_tree_cpp'
as_vlmc(x, alpha, cutoff, ...)

Arguments

x

an object to convert into a vlmc.

alpha

cut off parameter applied during the conversion, quantile scale (if specified)

cutoff

cut off parameter applied during the conversion, native scale (if specified)

...

additional arguments for conversion functions.

Details

This function converts a context tree into a VLMC. If alpha or cutoff is specified, it is used to reduce the complexity of the tree as in a direct call to vlmc() (prune()).

Value

a vlmc

See Also

ctx_tree()

tune_vlmc()

Examples

## conversion from a context tree
dts <- c(0, 1, 1, 1, 0, 0, 1, 0, 1, 0)
dts_ctree <- ctx_tree(dts, min_size = 1, max_depth = 3, backend = "C++")
draw(dts_ctree)
dts_vlmc <- as_vlmc(dts_ctree)
class(dts_vlmc)
draw(dts_vlmc)


[Package mixvlmc version 0.2.1 Index]