R implementation of HMMs described in processed report except function HMMLikelihood renamed to R_HMMLikelihood and changed to compute values for all capture histories and return lnl, alpha, phi, v, dmat, and gamma values. loglikelihood is called with a fitted hmm model and then computes the gamma,dmat and delta matrices and calls R_HMMLikelihood function. These are not used by the fitting code.
first: occasion to initiate likelihood calculation for sequence
m: number of states
T: number of occasions; sequence length
dmat: observation probability matrices
gamma: transition matrices
delta: initial distribution
object: fitted hmm model
ddl: design data list; will be computed if NULL
Returns
both return log-likelihood, alpha, v and phi arrays
References
Zucchini, W. and I.L. MacDonald. 2009. Hidden Markov Models for Time Series: An Introduction using R. Chapman and Hall, Boca Raton, FL. 275p. See page 45.