sampleSeq {tileHMM} | R Documentation |
Generates an observation sequence according to a model given as object
of class hmm
. Optionally the undelying state sequence is returned
together with the observations.
## S4 method for signature 'contHMM, numeric': sampleSeq(hmm, size, return.states=FALSE)
hmm |
Object of class contHMM . |
size |
Numeric value indicating the desired length of the observation sequence. |
return.states |
Logical indicating whether the underlying state sequence should be returned together with the observation sequence. |
If return.states
is FALSE
(the default) a vector of length size
with observations
sampled from hmm
. If return.states
is TRUE
a list with components
states |
Character vector with state sequence that was used to generate the observations. |
observation |
Vector with observations sampled from hmm . |
Peter Humburg
## create two state HMM with t distributions state.names <- c("one","two") transition <- c(0.035, 0.01) location <- c(1, 2) scale <- c(1, 1) df <- c(4, 6) hmm1 <- getHMM(list(a=transition, mu=location, sigma=scale, nu=df), state.names) ## generate observation sequence from model obs <- sampleSeq(hmm1, 100)