Learn R Programming

HMMCont (version 1.0)

statesDistributionsPlot: Probability Density Functions of the States

Description

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).

Usage

statesDistributionsPlot(hmm, sc = 1)

Arguments

hmm
An object of the class ContObservHMM.
sc
Scaling factor used when the initial HMM-object was set.

Value

Plot of the probability density functions.

See Also

Functions: hmmsetcont, baumwelchcont, and viterbicont.

Examples

Run this code

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 

Run the code above in your browser using DataLab