viterbicont: Viterbi Algorithm

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

Description

The function performs Viterbi algorithm (Viterbi, 1967). It can be applied to a ContObservHMM object after sufficient number of Baum-welch iterations (function baumwelchcont).

Usage

1

Arguments

hmm

An object of the class ContObservHMM.

Value

An object of the class ContObservHMM (see section on the function hmmsetcont). The object can be analysed with the class-specific functions print, summary, and plot.

Author(s)

Mikhail A. Beketov

References

Viterbi, A.J. 1967. Error bounds for convolutional codes and an asymptotically optimum decoding algorithm. IEEE Transactions on Information Theory. 13: 260-269.

See Also

Functions: hmmsetcont, baumwelchcont, and statesDistributionsPlot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
Returns<-logreturns(Prices) # Getting a stationary process
Returns<-Returns*10 		# Scaling the values
hmm<-hmmsetcont(Returns) 	# Creating a HMM object
for(i in 1:6){hmm<-baumwelchcont(hmm)} # Baum-Welch is 
# executed 6 times and results are accumulated

hmmcomplete<-viterbicont(hmm) # Viterbi execution

par(mfrow=c(2,1))
plot(hmmcomplete, Prices, ylabel="Price") 
plot(hmmcomplete, ylabel="Returns") # the revealed 
# Markov chain and the observations are plotted

HMMCont documentation built on May 1, 2019, 10:46 p.m.