forwardback: Computing the posterior marginals of hidden state variables...

View source: R/forwardback.R

forwardbackR Documentation

Computing the posterior marginals of hidden state variables using a sequence of observations

Description

Computing the posterior marginals of hidden state variables using a sequence of observations

Usage

forwardback(probTran, initQ)

Arguments

probTran

An nObs x nQ^2 matrix having each row represent P(Obs_k | state_k ) * P(state_k | state_{k-1}). Each row of probTran is such that matrix(probTran[1,], ncol=nQ, nrow=nQ, byrow =TRUE) is the probability above in matrix format.

initQ

A nQ-sized vector that represents the initial probability of the first link in a trip.

Value

probTran returns a list of alpha and beta (respectively forward and backward probability row-wise vectors) such that normalize(alpha[i] * beta[i]) is the smoothed HMM state estimate.

References

Russell, S., Norvig, P., 2009. Artificial Intelligence: A Modern Approach. Pearson Education, UK.


melmasri/traveltimeHMM documentation built on Jan. 6, 2023, 10:30 p.m.