Learn R Programming

HMMmlselect (version 0.1.6)

HMMmlselect-package: Determine the number of states in hidden Markov models via marginal likelihood

Description

(See the Manual.pdf file in "inst/extdata"" folder for a detail description of all functions, and a detail tutorial.)

This packages provides function to estimate the number of states in a Hidden Markov model (HMM) using the marginal likelihood method proposed by Chen, Fuh, Kao and Kou (2019+), which we would denoted as HMMml2017 afterward. HMMmlselect estimates the number of states, and PlotHMM plots. Other related functions are also provided.

Arguments

Details

Package: HMMmlselect
Type: Package
Version: 1.0
Date: 2019-2-08
License: GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007

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

Run this code
# NOT RUN {
library(HMMmlselect)

# simulate a 25 observations HMM
obs = HMMsim ( n = 25 )$obs

# perform order selection and estimation
results = HMMmlselect ( y = obs, list(Kfits = c(2,3), boolUseMclust = FALSE) )

# visualize the results, see figure 1
PlotHMM ( y = obs, results )
# }

Run the code above in your browser using DataLab