Sbackward: Computes The Backward Probabilities

Description Usage Arguments Value Author(s) Examples

View source: R/Sbackward.R

Description

The Sbackward function computes the backward probabilities. The backward probabilities for state 'S' up to output observations at time k is defined as the probability of observing the sequance of observations 'Y'(y_1, ... ,y_k) and that state at time 'k' is 'S'. that is:
f[k,X] := Prob(Y_k+1 = y_k+1, ... , Y_k = y_k ,S_k = S).
Where Y_1, ... ,Y_n = y_1, ... , y_n is sequance of observed emissions and S_k is a random variable that represents the state at time k.

Usage

1
Sbackward(initsa, x, y, theta=NULL)

Arguments

initsa

A Stochastic Model.

x

A vector of input sequance.

y

A vector of Output sequance.

theta

Optional Conditional Probabilities.

Value

Return Value:
backward A matrix containing the backward probabilities. The probabilities are given on a logarithmic scale (natural logarithm). This first dimension refer to the time and the second dimension to states.

Author(s)

Rehman Ahmad <rehman.ahmad777@gmail.com>

Examples

1
2
3
4
5
6
7
8
9
states<-c('s1','s2')
inputSymbols<-c('a','b')
outputSymbols<-c(0,1)
transProb<-matrix(c(0.70,0.50, 0.30,0.50), nrow = 2, ncol = 2,byrow = TRUE)
emissionProb<-matrix(c(0.50,0.30, 0.40,0.60,.50,.70,.60,.40), nrow = 2, ncol = 4, byrow = TRUE)
initsa<-initSA(states,inputSymbols,outputSymbols,emissionProb,transProb)
x<-c('b','a')
y<-c(0,1)
sb<-Sbackward(initsa, x, y)

SAutomata documentation built on May 2, 2019, 1:46 p.m.