You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For HMMs, is there a function that takes a hmodel.object (or a msm.object) and returns a list of hmmdist objects that can be passed to the hmodel argument in a new msm() call? For instance, it could be used in the following way:
# create first HMM
fit1 <- msm( y ~ time, subject = ptnum, data = example.df,
qmatrix = rbind( c(0, 0.25, 0), c(0, 0, 0.2), c(0, 0, 0)),
hmodel = list (hmmNorm(mean=90, sd=8), hmmNorm(mean=70, sd=8), hmmIdent(-9))
)
# extract hmodel.object from fit1
hmodel.fit1 <- hmodel.msm(fit1$hmodel)
# create second HMM with initial emission distribution paramaters from fit1
fit2 <- msm(y ~ time, subject = ptnum, data = example.df,
qmatrix = rbind( c(0, 0.25, 0.1), c(0.1, 0, 0.2), c(0, 0, 0)),
hmodel = hmodel.fit1
)
I've built a function that does this for a very specific multivariate categorical HMM but it would be useful to have a generic function that does this for any given hmodel.object.
Has this been considered? If not, could you provide any pointers on how best this might be achieved?
Cheers
The text was updated successfully, but these errors were encountered:
Not something I've ever needed, but happy to include it if you want to write it. I think it'd need a lookup table that maps the character labels identifying each class of emission distribution to the corresponding constructor functions in R/hmm-dists.R. The function could then extract the labels stored in fit1$hmodel$labels, and the parameter estimates, and build the constructors list.
For HMMs, is there a function that takes a
hmodel.object
(or amsm.object
) and returns a list ofhmmdist
objects that can be passed to thehmodel
argument in a newmsm()
call? For instance, it could be used in the following way:I've built a function that does this for a very specific multivariate categorical HMM but it would be useful to have a generic function that does this for any given
hmodel.object
.Has this been considered? If not, could you provide any pointers on how best this might be achieved?
Cheers
The text was updated successfully, but these errors were encountered: