simHMM: Simulate states and observations for a Hidden Markov Model

View source: R/HMM.r

simHMMR Documentation

Simulate states and observations for a Hidden Markov Model

Description

Simulates a path of states and observations for a given Hidden Markov Model.

Usage

simHMM(hmm, length)

Arguments

hmm

A Hidden Markov Model.

length

The length of the simulated sequence of observations and states.

Format

Dimension and Format of the Arguments.

hmm

A valid Hidden Markov Model, for example instantiated by initHMM.

Value

The function simHMM returns a path of states and associated observations:

states

The path of states.

observations

The sequence of observations.

Author(s)

Lin Himmelmann <hmm@linhi.com>, Scientific Software Development

See Also

See initHMM for instantiation of Hidden Markov Models.

Examples

# Initialise HMM
hmm = initHMM(c("X","Y"),c("a","b","c"))
# Simulate from the HMM
simHMM(hmm, 100)

HMM documentation built on March 23, 2022, 5:06 p.m.

Related to simHMM in HMM...