fitted.hmm: Fitted values for Hidden Markov Models

Description Usage Arguments Details Value Examples

View source: R/misc_methods.R

Description

Outputs predicted values of Hidden Markov Model in the form of a list where the first element is a vector of state predictions and second element is a vector of emission predictions (expected value corresponding predicted state).

Usage

1
2
## S3 method for class 'hmm'
fitted(x, method = "local", ...)

Arguments

x

Object of type hmm.

method

Method for state prediction. One of either 'local' (default, resulting in local decoding), 'viterbi' or 'global' (both resulting in global decoding using Viterbi's algorithm).

...

Other arguments.

Details

If the distribution family is one of the included standard families (Poisson, normal, binomial or exponential), the expected value will be the plug-in estimate using the fitted parameters of each state. Otherwise, the empirical mean will be used as the expected value.

Value

List of predicted states and emission values.

Examples

1
2
3
# Continuation of Earthquake example

fitted.values(hmm.EQ)

AdvancedR-2021/hmm documentation built on Dec. 17, 2021, 7:41 a.m.