HMMfit {HMMmlselect}R Documentation

HMMfit

Description

The following function performs (a) HMM fitting through the Expectation-Maximization al- gorithm (METHOD = 1), (b) HMM fitting through the Markov chain Monte Carlo algorithm (METHOD = 2), and (c) Gaussian mixture model fitting through the Markov chain Monte Carlo algorithm (METHOD = 3).

Usage

HMMfit(y, K, METHOD, optionalfit = list())

Arguments

y

The observed data.

K

The specified number of states of the underlying Markov chian.

METHOD

Integer value indicating the method of parameter estimation: (a) HMM fitting through the Expectation-Maximization al- gorithm (METHOD = 1), (b) HMM fitting through the Markov chain Monte Carlo algorithm (METHOD = 2), and (c) Gaussian mixture model fitting through the Markov chain Monte Carlo algorithm (METHOD = 3)

optionalfit

Optional variables as a list. Possible options include:

Details

See Manual.pdf in "inst/extdata" folder.

Value

This functions returns the fitting parameters of the observed data given the specified number of states.

References

Yang Chen, Cheng-Der Fuh, Chu-Lan Kao, and Samuel Kou (2019+) "Determine the number of states in hidden markov models via marginal likelihood." Submitted.

Examples

library(HMMmlselect)

# Example 1: use HMMfit to inference number of states
obs = HMMsim ( n = 200 )$obs
Nest = HMMfit( y = obs, K=3, METHOD = 1)

[Package HMMmlselect version 0.1.6 Index]