Description Usage Arguments Value References Examples
Computes the penalized negative log-likelihood using the forward algorithm as described in Adam et al. (2019). Not intended to be run by the user (internal function, called by the function fitMod
).
1 |
parvect |
Vector of working parameters (as returned by |
x |
Vector of observed counts. |
N |
Integer, number of states. |
stationary |
Logical, determines whether the initial distribution of the Markov chain underlying the observed counts is the stationary distribution. |
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. |
inflation |
Count probabilities to be excluded from penalization (e.g. in the presence of zero-inflation). |
Numeric, the penalized negative log-likelihood.
Adam, T., Langrock, R., and Wei<c3><9f>, C.H. (2019): Penalized Estimation of Flexible Hidden Markov Models for Time Series of Counts. arXiv:https://arxiv.org/pdf/1901.03275.pdf.
1 2 3 4 5 6 7 | # importing example data
x = read.table("http://www.hmms-for-time-series.de/second/data/earthquakes.txt")$V2
# computing the penalized negative log-likelihood
parvect = pn2pw(N=2,probs=cbind(dpois(x=0:41,lambda=14),dpois(x=0:41,lambda=26)),
gamma=matrix(c(0.95,0.05,0.05,0.95),ncol=2),delta=NULL,stationary=TRUE)
lambda = rep(10^4,2)
nLogLike(parvect=parvect,x=x,N=2,stationary=TRUE,lambda=lambda,sup=41,m=3,inflation=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.