Last data update: 2014.03.03

R: Probability Density Functions of the States
statesDistributionsPlotR Documentation

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.

Author(s)

Mikhail A. Beketov

See Also

Functions: hmmsetcont, baumwelchcont, and viterbicont.

Examples


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 

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(HMMCont)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/HMMCont/statesDistributionsPlot.Rd_%03d_medium.png", width=480, height=480)
> ### Name: statesDistributionsPlot
> ### Title: Probability Density Functions of the States
> ### Aliases: statesDistributionsPlot
> ### Keywords: Baum-Welch Viterbi
> 
> ### ** Examples
> 
> 
> 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 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>