GLMresponse function

Methods for creating depmix response models

Methods for creating depmix response models

Create GLMresponse objects for depmix models using formulae and family objects.

GLMresponse(formula, data=NULL, family=gaussian(), pstart=NULL, fixed=NULL, prob=TRUE, ...) ## S4 method for signature 'response' getdf(object)

Arguments

  • formula: A model formula.
  • data: An optional data.frame to interpret the variables from the formula argument in.
  • family: A family object;
  • pstart: Starting values for the coefficients and other parameters, e.g. the standard deviation for the gaussian() family.
  • fixed: Logical vector indicating which paramters are to be fixed.
  • prob: Logical indicating whether the starting values for multinomial() family models are probabilities or logistic parameters (see details).
  • object: Object of class response.
  • ...: Not used currently.

Details

GLMresponse is the default driver for specifying response distributions of depmix models. It uses the familiar formula interface from glm to specify how responses depend on covariates/predictors.

Currently available options for the family argument are binomial, gaussian, poisson, Gamma, and multinomial. Except for the latter option, the GLMresponse model is an interface to the glm functions of which the functionality is used: predict, fit and density functions.

The multinomial model takes as link functions mlogit, the default, and then uses functionality from the nnet package to fit multinomial logistic models; using mlogit as link allows only n=1 models to be specified, i.e. a single observation for each occasion; it also takes identity as a link function. The latter is typically faster and is hence preferred when no covariates are present.

See the responses help page for examples.

Returns

GLMresponse returns an object of class GLMresponse which extends the response-class.

getdf returns the number of free parameters of a response model.

See Also

makeDepmix has an example of specifying a model with a multivariate normal response and an example of how to add a user-defined response model, in particular an ex-gauss distribution used for the speed data.

Author(s)

Ingmar Visser & Maarten Speekenbrink