HMMPlotSerie | R Documentation |
This function plots the time series in each hidden state.
HMMPlotSerie(obs, states, dates=NULL, dis="NORMAL", color="green", oneFig=FALSE, ...)
obs |
The vector or the list of vectors of observations. |
states |
A ViterbiClass object which gives the hidden states or a vector or a lis of vectors of integer from 1 to the number of hidden states. |
dates |
An R object representing dates that can be plot as axis labels (e.g. Date object) |
dis |
Distribution name = 'NORMAL', 'DISCRETE', 'MIXTURE'. Default 'NORMAL'. |
color |
Color for the kernel density plot |
oneFig |
A boolean: if TRUE, plot different states series with different colors in a single plot. Default FALSE |
... |
Other parameters passed to plot function |
None.
HMMPlotSerie is not implemented for multivariate distributions.
The time series of observations for each hidden states of the model are plotted using:
plot(obs[states=i])) and i in 1..max(states).
viterbi, plot
data(n1d_3s)
#Fits an 3 states gaussian model
ResFit <- HMMFit(obs_n1d_3s, nStates=3)
VitPath <- viterbi(ResFit, obs_n1d_3s)
#plot the series
HMMPlotSerie(obs_n1d_3s, VitPath)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.