next up previous
Next: Error Structures Up: Structure of the Previous: Structure of the

Model Prototypes

The model objects are organized into several prototypes, with the general prototype glim-proto inheriting from regression-model-proto, the prototype for normal linear regression models. The inheritance tree is shown in Figure 1.

  
Figure 1: Hierarchy of generalized linear model prototypes.

This inheritance captures the reasoning by analogy to the linear case that is the basis for many ideas in the analysis of generalized linear models. The fitting strategy uses iteratively reweighted least squares by changing the weight vector in the model and repeatedly calling the linear regression :compute method.

Convergence of the iterations is determined by comparing the relative change in the coefficients and the change in the deviance to cutoff values. The iteration terminates if either change falls below the corresponding cutoffs. The cutoffs are set and retrieved by the :epsilon and :epsilon-dev methods. The default values are given by

> (send glim-proto :epsilon)
1e-06
> (send glim-proto :epsilon-dev)
0.001
A limit is also imposed on the number of iterations. The limit can be set and retrieved by the :count-limit message. The default value is given by
> (send glim-proto :count-limit)
30

The analogy captured in the inheritance of the glim-proto prototype from the normal linear regression prototype is based primarily on the computational process, not the modeling process. As a result, several accessor methods inherited from the linear regression object refer to analogous components of the computational process, rather than analogous components of the model. Two examples are the messages :weights and :y. The weight vector in the object returned by :weights is the final set of weights obtained in the fit; prior weights can be set and retrieved with the :pweights message. The value returned by the :y message is the artificial dependent variable

constructed in the iteration; the actual dependent variable can be obtained and changed with the :yvar message.

The message :eta returns the current linear predictor values, including any offset. The :offset message sets and retrieves the offset value. For binomial models, the :trials message sets and retrieves the number of trials for each observation.

The scale factor is set and retrieved with the :scale message. Some models permit the estimation of a scale parameter. For these models, the fitting system uses the :fit-scale message to obtain a new scale value. The message :estimate-scale determines and sets whether the scale parameter is to be estimated or not.

Deviances of individual observations, the total deviance, and the mean deviance are returned by the messages :deviances, :deviance and :mean-deviance, respectively. The :deviance and :mean-deviance methods adjusts for omitted observations, and the denominator for the mean deviance is adjusted for the degrees of freedom available.

Most inherited methods for residuals, standard errors, etc., should make sense at least as approximations. For example, residuals returned by the inherited :residuals message correspond to the Pearson residuals for generalized linear models. Other forms of residuals are returned by the messages



next up previous
Next: Error Structures Up: Structure of the Previous: Structure of the



Luke Tierney
Tue Jan 21 14:42:18 CST 1997