Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

trim_model

Trim Small Probabilities of Hidden Markov Model


Description

Function trim_model tries to set small insignificant probabilities to zero without decreasing the likelihood.

Usage

trim_model(model, maxit = 0, return_loglik = FALSE, zerotol = 1e-08,
  verbose = TRUE, ...)

Arguments

model

Model of class hmm or mhmm for which trimming is performed.

maxit

Number of iterations. After zeroing small values, the model is refitted, and this is repeated until there is nothing to trim or maxit iterations are done.

return_loglik

Return the log-likelihood of the trimmed model together with the model object. The default is FALSE.

zerotol

Values smaller than this are trimmed to zero.

verbose

Print results of trimming. The default is TRUE.

...

Further parameters passed on to fit_model.

See Also

build_hmm and fit_model for building and fitting hidden Markov models; and hmm_biofam for information on the model used in the example.

Examples

data("hmm_biofam")

# Testing if changing parameter values smaller than 1e-03 to zero
# leads to improved log-likelihood.
hmm_trim <- trim_model(hmm_biofam, zerotol = 1e-03, maxit = 10)

seqHMM

Mixture Hidden Markov Models for Social Sequence Data and Other Multivariate, Multichannel Categorical Time Series

v1.0.14
GPL (>= 2)
Authors
Jouni Helske [aut, cre] (<https://orcid.org/0000-0001-7130-793X>), Satu Helske [aut] (<https://orcid.org/0000-0003-0532-0153>)
Initial release
2019-10-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.