smooth.discrete: Smoothing a discrete time series.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/smooth.discrete-src.R

Description

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.

Usage

1
2
smooth.discrete(y, init = NULL, trans = NULL, parms.emission = 0.5, 
                method = "viterbi", details = 0, ...)

Arguments

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.

Details

The parameters are estimated using the Baum-Welch algorithm (a special case of the EM-algorithm).

Value

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

Author(s)

Søren Højsgaard <sorenh at agrsci.dk>

See Also

hmmspec, hmmfit

Examples

1
## Please see the vignette

jaredo/mhsmm documentation built on Dec. 6, 2019, 11:07 a.m.