trim_model {seqHMM} | R Documentation |
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 |
maxit |
Number of iterations. After zeroing small values, the model is
refitted, and this is repeated until there is nothing to trim or |
return_loglik |
Return the log-likelihood of the trimmed model together with
the model object. The default is |
zerotol |
Values smaller than this are trimmed to zero. |
verbose |
Print results of trimming. The default is |
... |
Further parameters passed on to |
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)
[Package seqHMM version 1.2.6 Index]