Description Usage Arguments Value Author(s) References See Also Examples
The function performs Viterbi algorithm (Viterbi, 1967). It can be applied to a ContObservHMM object after sufficient number of Baum-welch iterations (function baumwelchcont
).
1 | viterbicont(hmm)
|
hmm |
An object of the class ContObservHMM. |
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
.
Mikhail A. Beketov
Viterbi, A.J. 1967. Error bounds for convolutional codes and an asymptotically optimum decoding algorithm. IEEE Transactions on Information Theory. 13: 260-269.
Functions: hmmsetcont
,
baumwelchcont
, and
statesDistributionsPlot
.
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.