BaumWelch: Inferring the Forward and Backward Probabilities of a...

Description Usage Arguments Value Examples

View source: R/BaumWelch.R

Description

For an initial Stochastic Automata Model (SA) and a given sequence of observations, the Baum-Welch algorithm infers optimal forward and backward probabilities to the SA. Since the Baum-Welch algorithm is a variant of the Expectation-Maximisation algorithm, the algorithm converges to a local solution which might not be the global optimum.

Usage

1
BaumWelch(initsa, x, y, m, error, theta = NULL)

Arguments

initsa

A Stochastic Automata Model.

x

A sequence of inputs.

y

A sequence of outputs.

m

Maximum length of sequence to create sample set for learning.

error

Maximum error rate.

theta

Optional Conditional Probabilities.

Value

Returns the conditional probabilities by learning the sample set.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)
m<-1
error<-10
BaumWelch(initsa, x, y, m, error)

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