HMMGraphicDiag {RHmm}R Documentation

Graphic diagnostic of the HMM estimation

Description

This function plots the kernel density of the observations and the normal (mixture of normal, discrete) density with estimated parameters for each hidden states. The hidden states

Usage

HMMGraphicDiag(vit, HMM, obs, color="green")

Arguments

vit a ViterbiClass object which gives the hidden states
HMM a HMMClass or a HMMFitClass object which describes the model
obs the vector, list of vectors of observations
color color for the kernel density plot

Value

none

Note

HMMGraphicDiag is not implemented for multivariate distributions.

The kernel densities of observations for each hidden states of the model are plotting using:
plot(density(obs[vit$states=i])) and i in 1..HMM$nStates (or HMM$HMM$nStates)

See Also

HMMFit, viterbi

Examples

data(n1d_3s)
obs <- obs_n1d_3s
#Fits an 3 states gaussian model 
ResFit <- HMMFit(obs, nStates=3)
VitPath <- viterbi(ResFit, obs)
# Graphic diagnostic
HMMGraphicDiag(VitPath, ResFit, obs)

[Package RHmm version 1.2.0 Index]