Learn R Programming

depmixS4 (version 0.2-2)

forwardbackward: Forward and backward variables

Description

Compute the forward and backward variables of a depmix object.

Usage

## S3 method for class 'depmix':
forwardbackward(object, return.all=TRUE, ...)

Arguments

object
A depmix object.
return.all
If FALSE, only gamma and xi and the log likelihood are returned (which are the only variables needed in using EM).
...
Not currently used.

Value

  • forwardbackward returns a list of the following (the variables are named after the notation from Rabiner, 1989):
  • alphaThe forward variables.
  • betaThe backward variables.
  • gammaThe smoothed transition probabilities.
  • xiThe smoothed state probabilities.
  • scaThe scale factors (called lambda in Rabiner).
  • logLikeThe log likelihood (which is sum(log(sca)).
  • If return.all=FALSE, only gamma, xi and the log likelihood are returned.

References

Lawrence R. Rabiner (1989). A tutorial on hidden Markov models and selected applications in speech recognition. Proceedings of IEEE, 77-2, p. 267-295.

Examples

Run this code
# add some later

Run the code above in your browser using DataLab