Description Usage Arguments Value Author(s) See Also Examples
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.
1 2 |
hmm |
Object of class |
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 |
Peter Humburg
1 2 3 4 5 6 7 8 9 10 11 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.