R Example
Visser & Speekenbrink: Sec 3
S&P 500
# load package
require(hmmr)
data('sp500')
# fit data using lca, default is Gaussian distribution.
m1 <- lca(sp500$logret, nclasses = 1)
m2 <- lca(sp500$logret, nclasses = 2)
m3 <- lca(sp500$logret, nclasses = 3)
# obtain posterior probability
# method for obtain posterior probability, such as vertibit, smoothing
# smoothing in mixture model gives exact posterior probability defined previously
pst1 <- posterior(m2, type = 'smoothing')
# local method directly gives component based on maximum posterior probability
pstState <- posterior(m2, type = 'local')
# actual posterior probability is very different from the estimated probability
# indicates components not well separated
table(pstState) / sum(table(pstState))Conservation data
BIC weights and relative probability
Fitting multivariate normal distribution response model
Degenerate solutions due to singular covariance matrix
Fitting Independent Gaussian Distribution
PreviousModel Covariates Effect on Prior ProbabilityNextMiscellaneous in Stat, Linear Algebra, and Deep Learning
Last updated