mstep.pois: Performs re-estimation (the M-step) for a Poisson emission...

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

View source: R/spec_functions.R

Description

Re-estimates the parameters of a Poisson emission distribution as part of the EM algorithm for HMMs and HSMMs. This is called by the hmm and hsmm functions. It is a suitable prototype function for users wishing to design their own emission distributions.

Usage

1
mstep.pois(x, wt)

Arguments

x

A vector of observed values

wt

A T x J matrix of weights. Column entries are the weights for respective states.

Details

Users may write functions that take the same arguments and return the same values for their own custom emission distributions.

Value

Returns the emission slot of a hmmspec or hsmmspec object

lambda

Vector of length J containing the Poisson parameters for each state j

Author(s)

Jared O'Connell [email protected]

See Also

rpois.hsmm, dpois.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.