Trim Small Probabilities of Hidden Markov Model
Function trim_model
tries to set small insignificant probabilities to zero
without decreasing the likelihood.
trim_model(model, maxit = 0, return_loglik = FALSE, zerotol = 1e-08, verbose = TRUE, ...)
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 |
build_hmm
and fit_model
for building and fitting
hidden Markov models; and hmm_biofam
for information on the model used
in the example.
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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.