Description Usage Arguments Details Value References Examples
View source: R/HMMorderselectionfacility.R
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).
1 |
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: |
Ngibbs: Number of samples when using MCMC. Default is 5000.
Burnin: Length of burnin period when using MCMC. Default is 5000.
Thin: Thinning parameter when using MCMC. Default is 10.
Nstart: Number of starting points. Default is 50.
verbose: Logic variable indicating pritting details or not. Default is FALSE
.
priors: Prior when using MCMC. Default is flat.
See Manual.pdf in "inst/extdata" folder.
This functions returns the fitting parameters of the observed data given the specified number of states.
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.
1 2 3 4 5 | library(HMMmlselect)
# Example 1: use HMMfit to inference number of states
obs = HMMsim ( n = 200 )$obs
Nest = HMMfit( y = obs, K=3, METHOD = 1)
|
begin Baum Welch
Baum-Welch Results:
0.948617 2.128402 3.077285
0.086997 0.149623 0.080536
0.282187 0.320598 0.397215
0.311743 0.434483 0.253773
0.257478 0.490784 0.251737
LL -232.027760; s2:
0.122018 0.122018 0.122018
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.