stateProbs: State probabilities

Description Usage Arguments Value References Examples

View source: R/stateProbs.R

Description

For a given model, computes the probability of the process being in the different states at each time point.

Usage

1
stateProbs(m, hierarchical = FALSE)

Arguments

m

A momentuHMM or momentuHierHMM object.

hierarchical

Logical indicating whether or not to return a list of state probabilities for each level of a hierarchical HMM. Ignored unless m is a momentuHierHMM object.

Value

The matrix of state probabilities, with element [i,j] the probability of being in state j in observation i.

References

Zucchini, W. and MacDonald, I.L. 2009. Hidden Markov Models for Time Series: An Introduction Using R. Chapman & Hall (London).

Examples

1
2
3
4
# m is a momentuHMM object (as returned by fitHMM), automatically loaded with the package
m <- example$m

sp <- stateProbs(m)

momentuHMM documentation built on Sept. 5, 2021, 5:17 p.m.