Download Random Effects in AD Model Builder - available
Transcript
Given the Cholesky factor L, we can proceed in different directions. One option is to use the same transformation-of-variable technique as above: Start out with a vector u of independent N (0, 1) distributed random effects. Then, the vector x = L*u; has correlation matrix C = LL0 . Finally, we multiply each component of x by the appropriate standard deviation: y = elem_prod(x,sigma); 3.3.1 Large structured covariance matrices In some situations, for instance, in spatial models, q will be large (q = 100, say). Then it is better to use the approach outlined in Section 4.5. 3.4 Non-Gaussian random effects Usually, the random effects will have a Gaussian distribution, but technically speaking, there is nothing preventing you from replacing the normality assumption, such as f -= -nobs*log(sigma_x) - 0.5*norm2((x-mu)/sigma_x); with a log gamma density, say. It can, however, be expected that the Laplace approximation will be less accurate when you move away from normal priors. Hence, you should instead use the transformation trick that we learned earlier, but now with a non-linear transformation. A simple example of this yielding a log-normal prior was given in Section 2.4. Say you want x to have cumulative distribution function F (x). It is well known that you achieve this by taking x = F −1 (Φ(u)), where Φ is the cumulative distribution function of the N (0, 1) distribution. For a few common distributions, the composite transformation F −1 (Φ(u)) has been coded up for you in admb-re, and all you have to do is: 1. Define a random effect u with a N (0, 1) distribution. 2. Transform u into a new random effect x using one of something_deviate functions described below. where something is the name of the distribution. As an example, say we want to obtain a vector x of gamma distributed random effects (probability density xa−1 exp(−x)/Γ(a)). We can then use the code: PARAMETER_SECTION init_number a init_number lambda vector x(1,n) random_effects_vector u(1,n) // Shape parameter // Scale parameter 3-4