fitMod {countHMM} | R Documentation |
fitMod
Description
Estimates the parameters of a hidden Markov model using maximum penalized likelihood estimation. For details, see Adam et al. (2019).
Usage
fitMod(x,N=2,probs0=NULL,gamma0=NULL,delta0=NULL,stationary=TRUE,lambda=NULL,sup=NULL,m=3,
inflation=NULL)
Arguments
x |
Vector containing the observed time series of counts. |
N |
Integer, number of states. Default is |
probs0 |
Matrix with |
gamma0 |
Initial parameter values for the transition probabilities of the Markov chain underlying the observed counts. Matrix with |
delta0 |
Initial parameter values for the initial probabilities of the Markov chain underlying the observed counts. Vector of length |
stationary |
Logical, determines whether the initial distribution of the Markov chain underlying the observed counts is the stationary distribution. Default is |
lambda |
Vector of length |
sup |
Integer, determines the upper bound of the support of the state-dependent distributions. If |
m |
Integer, order of the difference penalties. Default is |
inflation |
Count probabilities to be excluded from penalization (e.g. in the presence of zero-inflation). Default is |
Value
An object of type countHMM.
References
Adam, T., Langrock, R., and Weiß, C.H. (2019): Penalized Estimation of Flexible Hidden Markov Models for Time Series of Counts. arXiv:https://arxiv.org/pdf/1901.03275.pdf.
Examples
# importing example data
x = read.table("http://www.hmms-for-time-series.de/second/data/earthquakes.txt")$V2
# model fitting
lambda = rep(10^4,2)
fitMod(x=x,lambda=lambda)