Description Usage Arguments Value Author(s) See Also Examples
The function plots the Gaussian probability density functions from the means and variances of the whole data set, the two sub-sets corresponding to the two Markov chain states, and additionally from the HMM model (i.e. the means and variances taken form the last Baum-Welch iteration).
1 | statesDistributionsPlot(hmm, sc = 1)
|
hmm |
An object of the class ContObservHMM. |
sc |
Scaling factor used when the initial HMM-object was set. |
Plot of the probability density functions.
Mikhail A. Beketov
Functions: hmmsetcont
,
baumwelchcont
, and
viterbicont
.
1 2 3 4 5 6 7 8 9 | 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
statesDistributionsPlot(hmmcomplete, sc=10) # PDFs of
# the whole data set and two states are plotted
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.