View source: R/smooth.discrete-src.R
smooth.discrete | R Documentation |
The smooth.discrete() function provides a simple smoothing of a time series of discrete values measured at equidistant times. Under the hood of smooth.discrete() is a hidden Markov model.
smooth.discrete(y, init = NULL, trans = NULL, parms.emission = 0.5,
method = "viterbi", details = 0, ...)
y |
A numeric vector |
init |
Initial distribution (by default derived from data; see the vignette for details) |
trans |
Transition matrix (by default derived from data; see the vignette for details) |
parms.emission |
Matrix describing the conditional probabilities of the observed states given the latent states. (See the vignette for details). |
method |
Either "viterbi" or "smoothed". The viterbi method gives the jointly most likely sequence; the smoothed method gives the sequence of individually most likely states. |
details |
Controlling the amount of information printed. |
... |
Further arguments passed on to the "hmmfit" function. |
The parameters are estimated using the Baum-Welch algorithm (a special case of the EM-algorithm).
A list with the following components:
s |
The "smoothed" states |
model |
The underlying hmm (hidden Markov model) object |
data |
The data |
initial |
The initial parameters |
S<c3><b8>ren H<c3><b8>jsgaard <sorenh at math.aau.dk>
hmmspec
, hmmfit
## Please see the vignette
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.