Various methods for depmix
and mix
objects.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 
## S4 method for signature 'depmix'
logLik(object,method=c("fb","lystig","classification"),na.allow=TRUE)
## S4 method for signature 'mix'
logLik(object,method=c("fb","lystig","classification"),na.allow=TRUE)
## S4 method for signature 'depmix.fitted.classLik'
logLik(object,method=c("classification","fb","lystig"),na.allow=TRUE)
## S4 method for signature 'mix.fitted.classLik'
logLik(object,method=c("classification","fb","lystig"),na.allow=TRUE)
## S4 method for signature 'depmix'
nobs(object, ...)
## S4 method for signature 'mix'
nobs(object, ...)
## S4 method for signature 'depmix'
npar(object)
## S4 method for signature 'mix'
npar(object)
## S4 method for signature 'depmix'
freepars(object)
## S4 method for signature 'mix'
freepars(object)
## S4 method for signature 'depmix'
setpars(object,values, which="pars",...)
## S4 method for signature 'mix'
setpars(object,values, which="pars",...)
## S4 method for signature 'depmix'
getpars(object,which="pars",...)
## S4 method for signature 'mix'
getpars(object,which="pars",...)
## S4 method for signature 'depmix'
getmodel(object,which="response",state=1,number=1)
## S4 method for signature 'mix'
getmodel(object,which="response",state=1,number=1)

object 
A 
values 
To be used in 
method 
The log likelihood can be computed by either the forward
backward algorithm (Rabiner, 1989), or by the method of Lystig and
Hughes, 2002. The former is the default and implemented in a fast
C routine. The forwardbackward routine also computes the state and transition
smoothed probabilities, which are not directly neccessary for the log likelihood.
Those smoothed variables, and the forward and backward variables are accessible
through the 
na.allow 
Allow missing observations? When set to FALSE, the logLik method will return NA in the presence of missing observations. When set to TRUE, missing values will be ignored when computing the likelihood. When observations are partly missing (when a multivariate observation has missing values on only some of its dimensionis), this may give unexpected results. 
which 

state 
In 
number 
In 
... 
Not used currently. 
logLik 
returns a 
nobs 
returns the number of observations (used in computing the BIC). 
npar 
returns the number of paramaters of a model. 
freepars 
returns the number of nonredundant parameters. 
setpars 
returns a 
getpars 
returns a vector with the current parameter values. 
getmodel 
returns a submodel of a 
Ingmar Visser
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  # create a 2 state model with one continuous and one binary response
data(speed)
mod < depmix(list(rt~1,corr~1),data=speed,nstates=2,family=list(gaussian(),multinomial()))
getmodel(mod,"response",2,1)
getmodel(mod,"prior")
# get the loglikelihood of the model
logLik(mod)
# to see the ordering of parameters to use in setpars
mod < setpars(mod, value=1:npar(mod))
mod
# to see which parameters are fixed (by default only baseline parameters in
# the multinomial logistic models for the transition models and the initial
# state probabilities model)
mod < setpars(mod, getpars(mod,which="fixed"))
mod

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.