The link function **g** for a generalized linear model relates the
linear predictor to the mean response by

Links are implemented as objects. Table 1 lists the pre-defined link functions, along with the expressions used to return link objects.

**Table 1:** Link Functions and Expression for Obtaining Link Objects

With one exception, the pre-defined links require no parameters.
These link objects can therefore be shared among models. The exception
is the power link. Links for binomial models are defined for **n = 1**
trials and assume .

Link objects inherit from the ` glim-link-proto` prototype. The
` log-link` object, for example, is constructed by

(defproto log-link () () glim-link-proto)Since this prototype can be used directly in model objects, the convention of having prototype names end in

> log-link #<Glim Link Object: LOG-LINK>

The ` glim-proto` computing methods assume that a link object
responds to three messages:
`
(send link :eta mu)`

(send link :means eta)

(send link :derivs mu)

`
The :eta method returns a sequence of linear predictor values
for a particular mean sequence. The :means method is the
inverse of :eta: it returns mean values for specified values
of the linear predictor. The :derivs method returns the values of
`

`
at the specified mean values. As an example, for the log-link
object these three methods are defined as
`

(defmeth log-link :eta (mu) (log mu)) (defmeth log-link :means (eta) (exp eta)) (defmeth log-link :derivs (mu) (/ mu))

Alternative link structures can be constructed by setting up a new
prototype and defining appropriate ` :eta`, ` :means`, and
` :derivs` methods. Parametric link families can be implemented by
providing one or more slots for holding the parameters. The power link
is an example of a parametric link family. The power link prototype
is defined as

(defproto power-link-proto '(power) () glim-link-proto)The slot

(defmeth power-link-proto :power () (slot-value 'power))and the

(defmeth power-link-proto :isnew (power) (setf (slot-value 'power) power))Thus a power link for a particular exponent, say the exponent 2, can be constructed using the expression

(send power-link-proto :new 2)

To complete the power link prototype, we need to define the three required methods. They are defined as

(defmeth power-link-proto :eta (mu) (^ mu (send self :power)))

(defmeth power-link-proto :means (eta) (^ eta (/ (slot-value 'power))))and

(defmeth power-link-proto :derivs (mu) (let ((p (slot-value 'power))) (* p (^ mu (- p 1)))))The definition of the

(defmeth power-link-proto :print (&optional (stream t)) (format stream ``#<Glim Link Object: Power Link (~s)>'' (send self :power)))Thus a square link prints as

> (send power-link-proto :new 2) #<Glim Link Object: Power Link (2)>

`
`

Tue Jan 21 14:42:18 CST 1997