HMMPlotSerie: Plot univariates series in each estimated states

View source: R/RHmm.R

HMMPlotSerieR Documentation

Plot univariates series in each estimated states

Description

This function plots the time series in each hidden state.

Usage

    HMMPlotSerie(obs, states, dates=NULL, dis="NORMAL", color="green", oneFig=FALSE, ...)
    

Arguments

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

Value

None.

Note

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

See Also

viterbi, plot

Examples

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)

RHmm documentation built on Nov. 30, 2023, 7:22 p.m.

Related to HMMPlotSerie in RHmm...