dpois.hsmm: Emission density function for Poisson emission distribution

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/spec_functions.R

Description

Calculates the density of observations x for state j given the parameters in model. This is used for a Poisson emission distribution of a HMM or HSMM and is a suitable prototype for user's to make their own custom distributions.

Usage

1
dpois.hsmm(x, j, model)

Arguments

x

Observed value

j

State

model

A hsmmspec or hmmspec object

Details

This is used by hmm and hsmm to calculate densities for use in the E-step of the EM algorithm. It can also be used as a template for users wishing to building their own emission distributions

Value

A vector of probability densities.

Author(s)

Jared O'Connell [email protected]

See Also

mstep.pois, rpois.hsmm

Examples

1
2
3
4
5
6
7
8
9
  J<-3
  initial <- rep(1/J,J)
  P <- matrix(c(.8,.5,.1,0.05,.2,.5,.15,.3,.4),nrow=J)
  b <- list(lambda=c(1,3,6))
  model <- hmmspec(init=initial, trans=P, parms.emission=b,dens.emission=dpois.hsmm)
  model
  train <- simulate(model, nsim=300, seed=1234, rand.emis=rpois.hsmm)
  plot(train,xlim=c(0,100))  
  h1 = hmmfit(train,model,mstep=mstep.pois)

mhsmm documentation built on May 30, 2017, 3:26 a.m.