Download Random Effects in AD Model Builder - available

Transcript
Chapter 3
Random Effects Modeling
This chapter describes all admb-re features except those related to “separability,” which are
dealt with in Chapter 4. Separability, or the Markov property, as it is called in statistics, is
a property possessed by many model classes. It allows admb-re to generate more efficient
executable programs. However, most admb-re concepts and techniques are better learned
and understood without introducing separability. Throughout much of this chapter, we will
refer to the program simple.tpl from Section 2.3.
3.1
The objective function
As with ordinary admb, the user specifies an objective function in terms of data and parameters. However, in admb-re, the objective function must have the interpretation of being a
(negative) log-likelihood. One typically has a hierarchical specification of the model, where
at the top layer, data are assumed to have a certain probability distribution conditionally
on the random effects (and the hyper-parameters), and at the next level, the random effects
are assigned a prior distribution (typically, normal). Because conditional probabilities are
multiplied to yield the joint distribution of data and random effects, the objective function
becomes a sum of (negative) log-likelihood contributions, and the following rule applies:
F The order in which the different log-likelihood contributions are added to the objective
function does not matter.
An addition to this rule is that all programming variables have their values assigned before
they enter in a prior or a likelihood expression. Winbugs users must take care when porting
their programs to admb, because this is not required in Winbugs.
The reason why the negative log-likelihood is used is that for historical reasons, admb
does minimization (as opposed to maximization). In complex models, with contributions
to the log-likelihood coming from a variety of data sources and random effects priors, it
is recommended that you collect the contributions to the objective function using the -=
operator of C++, i.e.,
f -= -nobs*log(sigma_x) - 0.5*norm2((x-mu)/sigma_x);
3-1