R_HMMLikelihood function

Hidden Markov Model Functions

Hidden Markov Model Functions

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.

R_HMMLikelihood(x,first,m,T,dmat,gamma,delta) loglikelihood(object,ddl=NULL)

Arguments

  • x: single observed sequence (capture history)
  • 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.

Author(s)

Jeff Laake

  • Maintainer: Jeff Laake
  • License: GPL (>= 2)
  • Last published: 2023-10-19

Useful links