Description Usage Arguments Details Functions Examples
Functions for evaluating model fitness of a hidden Markov model using AIC, BIC and log-likelihood.
1 2 3 4 5 6 7 8 |
object |
Object of class |
... |
Optinally more fitted model objects. |
k |
numeric, the penalty per parameter to be used; the default k = 2 is the classical AIC |
The log-likelihood is calculated using a combination of the forward algorithm for finding the (regular) likelihood and the log-sum-exp-trick to properly convert this to a log-likelihood in order to avoid underflow.
The AIC and BIC are calculated as usual, where the number of parameters is (m^2-1) + k where m is the number of states and k is the number of parameters in the emission distributions.
This is because we estimate m*(m-1) probabilities in the transition matrix and m-1 probabilities in the initial distribution vector, i.e. (m+1)(m-1) = m^2-1 in all.
All of this, however, is done during the creation of the hmm
instance, so this function simply returns the values stored in the object.
AIC.hmm
: Returns the AIC of the HMM.
BIC.hmm
: Returns the BIC of the HMM.
logLik.hmm
: Returns the log-likelihood of the HMM
1 2 3 4 5 6 7 8 9 10 11 12 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.