This function returns a trimmed VLMC from which match positions have been removed.
Source:R/vlmc_trim.R
trim.vlmc.Rd
This function returns a trimmed context tree from which match positions have been removed.
Usage
# S3 method for vlmc
trim(ct, ...)
Examples
## VLMC trimming is generally useless unless match positions were kept
pc <- powerconsumption[powerconsumption$week %in% 5:6, ]
dts <- cut(pc$active_power, breaks = 4)
model <- vlmc(dts, keep_match = TRUE)
print(object.size(model))
#> 56728 bytes
model <- trim(model)
## memory use should be reduced
print(object.size(model))
#> 15064 bytes
nm_model <- vlmc(dts)
print(object.size(nm_model))
#> 15064 bytes
nm_model <- trim(nm_model)
## no effect when match positions are not kept
print(object.size(nm_model))
#> 15064 bytes