Description Usage Arguments Value Author(s) References See Also Examples
The function performs Baum-Welch algorithm with Gaussian PDFs (Baum et al, 1970; Rabiner, 1989). It allows to control the model parameters after each iteration, and accumulates the information on the model evolution. The intended use is to perform repeated executions and to save the returned object into the argument object (see examples below).
1 | baumwelchcont(hmm)
|
hmm |
An object of the class ContObservHMM. |
An object of the class ContObservHMM (see section on the function hmmsetcont
). After sufficient number of iterations the object can be used to derive the Markov states sequence by the Viterbi algorithm (function viterbicont
). The object can be analysed with the class-specific functions print
, summary
, and plot
.
Mikhail A. Beketov
Baum, L.E., Petrie, T., Soules, G., and Weiss, N. 1970. A maximization technique occurring in the statistical analysis of probabilistic functions of Markov chains. The Annals of Mathematical Statistics. 41: 164-171.
Rabiner, L.R. 1989. A tutorial on hidden Markov models and selected applications in speech recognition. Proceedings of the IEEE. 77: 257-286.
Functions: hmmsetcont
,
viterbicont
, and
statesDistributionsPlot
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | Returns<-logreturns(Prices) # Getting a stationary process
Returns<-Returns*10 # Scaling the values
hmm<-hmmsetcont(Returns) # Creating a HMM object
print(hmm) # Checking the initial parameters
hmm<-baumwelchcont(hmm) # First iteration
print(hmm) # Inspecting
for(i in 1:5){hmm<-baumwelchcont(hmm)} # Subsequent iterations
print(hmm) # Inspecting
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.