Revision 1075 trunk/docs/manuals/admb-re/admbre.tex

admbre.tex (revision 1075)
23 23
\begin{document}
24 24

  
25 25
\title{%
26
    \largetitlepart{Random Effects in\\ \ADM}
27
    \smalltitlepart{ADMB-RE User Guide}
28
    \vspace{4.5ex}\textsf{\textit{Version \admbversion~~(2013-05-01)\\[3pt]
26
  \largetitlepart{Random Effects in\\\ADM}
27
  \smalltitlepart{ADMB-RE User Guide}
28
  \vspace{4.5ex}\textsf{\textit{Version \admbversion~~(2013-05-01)\\[3pt]
29 29
      Revised manual~~(2013-06-24)}}\vspace{3ex}
30 30
}
31 31
% Author definition.
......
38 38
\noindent ADMB Foundation, Honolulu.\\\\
39 39
\noindent This is the manual for AD Model Builder with Random Effects (ADMB-RE)
40 40
version \admbversion.\\\\
41
\noindent Copyright \copyright\ 2004, 2006, 2008, 2009, 2011, 2013 Hans Skaug \& David
42
Fournier\\\\
41
\noindent Copyright \copyright\ 2004, 2006, 2008, 2009, 2011, 2013 Hans Skaug \&
42
David Fournier\\\\
43 43
\noindent The latest edition of the manual is available at:\\
44 44
\url{http://admb-project.org/documentation/manuals}
45 45

  
......
62 62
This document is a user's guide to random-effects modelling in \ADM\ (\scAB).
63 63
Random effects are a feature of \scAB, in the same way as profile likelihoods
64 64
are, but are sufficiently complex to merit a separate user manual. The work on
65
the random-effects ``module'' (\scAR) started around~2003. The pre-existing part
65
the random-effects ``module'' (\scAR) started around 2003. The pre-existing part
66 66
of \scAB\ (and its evolution) is referred to as ``ordinary'' \scAB\ in the
67
following. This manual refers to Version~9.0.x of \scAB\ (and~\scAR).
67
following.
68 68

  
69 69
Before you start with random effects, it is recommended that you have some
70 70
experience with ordinary \scAB. This manual tries to be self-contained, but it
71 71
is clearly an advantage if you have written (and successfully run) a few
72
\textsc{tpl}~files. Ordinary \scAB\ is described in the \scAB\
72
\textsc{tpl} files. Ordinary \scAB\ is described in the \scAB\
73 73
manual~\cite{admb_manual}, which is available from
74 74
\href{mailto:admb-project.org}{admb-project.org}. If you are new to \scAB, but
75 75
have experience with \cplus\ (or a similar programming language), you may
......
79 79
only can handle mixed-effect regression type models, but this is very
80 80
misleading. ``Latent variable'' would have been a more precise term. It can be
81 81
argued that \scAR\ is the most flexible latent variable framework around. All
82
the mixed-model stuff in software packages, such as allowed by~R, Stata,
82
the mixed-model stuff in software packages, such as allowed by R, Stata,
83 83
\textsc{spss}, etc., allow only very specific models to be fit. Also, it is
84 84
impossible to change the distribution of the random effects if, say, you wanted
85 85
to do that. The \textsc{nlmixed} macro in \textsc{sas} is more flexible, but
......
101 101
Why use \ADM\ for creating nonlinear random-effects models? The answer consists
102 102
of three words: ``flexibility,'' ``speed,'' and ``accuracy.'' To illustrate
103 103
these points. a number of examples comparing \scAR\ with two existing packages:
104
\textsc{nlme}, which runs on R and Splus, and \scWinBUGS. In general, \scNLME\
104
\textsc{nlme}, which runs on R and S-Plus, and \scWinBUGS. In general, \scNLME\
105 105
is rather fast and it is good for the problems for which it was designed, but it
106 106
is quite inflexible. What is needed is a tool with at least the computational
107 107
power of \textsc{nlme} yet the flexibility to deal with arbitrary nonlinear
108 108
random-effects models. In Section~\ref{lognormal}, we consider a thread from the
109
R~user list, where a discussion took place about extending a model to use random
109
R user list, where a discussion took place about extending a model to use random
110 110
effects with a log-normal, rather than normal, distribution. This appeared to be
111 111
quite difficult. With \scAR, this change takes one line of code. \scWinBUGS, on
112 112
the other hand, is very flexible, and many random-effects models can be easily
......
220 220

  
221 221
\subsection{Writing an \scAB\ program}
222 222

  
223
%\XX{\fontindexentry{sc}{tpl} file}{writing}
223
% \XX{\fontindexentry{sc}{tpl} file}{writing}
224 224
\index{TPL@\textsc{tpl} file!writing}
225 225
To fit a statistical model to data, we must carry out certain fundamental tasks,
226 226
such as reading data from file, declaring the set of parameters that should be
......
238 238
A \textsc{tpl}~file is divided into a number of ``sections,'' each representing
239 239
one of the fundamental tasks mentioned above. See
240 240
Table~\ref{tab:required-sections} for the required sections.
241
\begin{table}[h]
241
\begin{table}[htbp]
242 242
  \begin{center}
243 243
    \begin{tabular}%
244
      {@{\vrule height 12pt depth 6pt width0pt}@{\extracolsep{1em}} l l }
244
      {@{\vrule height 12pt depth 6pt width0pt}@{\extracolsep{1em}} ll}
245 245
      \hline
246
      \textbf{Name}               & \textbf{Purpose} \\ \hline\\[-16pt]
246
      \textbf{Name}
247
      & \textbf{Purpose}                                          \\
248
      \hline\\[-16pt]
247 249
      \texttt{DATA\_SECTION}
248
      & Declare ``global'' data objects, initialization from file. \\
249
      \texttt{PARAMETER\_SECTION} & Declare independent parameters. \\
250
      & Declare ``global'' data objects, initialization from file.\\
251
      \texttt{PARAMETER\_SECTION}
252
      & Declare independent parameters.                           \\
250 253
      \texttt{PROCEDURE\_SECTION}
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff