HMMGraphicDiag {RHmm} | R Documentation |
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
HMMGraphicDiag(vit, HMM, obs, color="green")
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 |
none
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)
HMMFit, viterbi
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)