HMMGraphicDiag: Graphic diagnostic of the HMM estimation

View source: R/RHmm.R

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

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)

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

Related to HMMGraphicDiag in RHmm...