Learn R Programming

depmixS4 (version 0.2-1)

response: Methods for creating depmix response models

Description

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

Usage

GLMresponse(formula, data=NULL, family=gaussian(), pstart=NULL, 
		fixed=NULL, prob=TRUE, ...)
	
	transInit(formula, nstates, data=NULL, family=multinomial(),
		pstart=NULL, fixed=NULL, prob=TRUE, ...)
	
	## S3 method for class '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; see the responses help page a list of currently available options.
pstart
Starting values for the coefficients and other parameters, ie 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).
nstates
The number of states of the model.
object
Object of class response.
...
Not used currently.

Value

  • GLMresponse and transInit return objects of class GLMresponse and transInit respectively; both classes extend the response-class. getdf returns the number of free parameters of a response model.

Details

Both methods use the familiar formula interface from glm to specify how responses (or transition or prior parameters) depend on covariates/predictors. The GLMresponse model is an interface to the glm functions of which the functionality is leant: predict, fit and density functions. The transInit response model provides functionality for multinomial responses that are currently fit using nnet (this may change in the future but this should not affect the interface of this function). Note that the transInit model actually lacks a reponse, ie the y-slot is empty, at the time of construction, as the transitions are not observed.