If I have fit a model mf
with depmix()
and fit()
using depmixS4
package, and I want to know the log-likelihood of generating a given sequence s
, how should I do?
I know in the HiddenMarkov
package I can use forwardback(s, mf$Pi, mf$...)$LL
to get the log-likelihood, but I find the forwardbackward()
function in depmixS4
does not work similarly.
Finally I found the way myself, as first time working with S4...
Firstly initialize a model (depmix obj) with
depmix()
, and then update it with parameters in the fittedmf
usingsetpars()
. After that theforwardbackward()
will workAnyone knows better solution plz tell me...