1 of 23

MAR 536: Biological Statistics II

Lecture 18

Spatial mixed effects models

(Acknowledgements: Jim Thorson, Sean Anderson)

07 April 2020

2 of 23

Today’s Outline

  • Review of linear mixed effects models
  • Spatial autocorrelation, variograms
  • Spatial mixed effects models

3 of 23

Linear Mixed Effects Models

Vector of fixed effects

Vector of random effects

Observations for group i

The traditional linear modeling framework is a special case

of this model in which there are no random effects.

4 of 23

Estimation of mixed effects models

Maximum Likelihood Estimation (MLE)

is the vector of fixed effects parameters.

are the parameters controlling the distribution for the random effects.

We integrate across the random effects.

Effectively weight the probability of the observations given values for random effects by the probability of those values.

In the linear case, closed form solutions exist. For nonlinear models, either evaluate numerically or use approximations.

5 of 23

Spatial autocorrelation – wheat fields

6 of 23

Model for wheat yield by variety

7 of 23

Residuals show spatial pattern

8 of 23

A variogram shows how the covariance changes with distance between observations.

9 of 23

Update the model with correlation model in residuals

10 of 23

Residual pattern is removed

11 of 23

Spatial Mixed Effects Models

Vector of fixed effects

spatial random effects

Observations at location j

Include a spatial random effect term for each area, the distribution�for these is governed by a variance-covariance matrix, often�decomposed into a variance term, and a distance-based

spatial correlation matrix.

Spatial covariance

12 of 23

13 of 23

Fitting non-linear mixed effects models

  • R can be used to fit non-linear mixed effects models (function nlme).
  • To fit non-linear mixed effects models using EXCEL you need to evaluate the integral numerically, or apply a method such as the Laplace approximation.

  • is the value of ε obtained by maximizing�given fixed values of θ and τ, and is the determinant of the matrix of second derivatives.

  • This approximation is exact when the distribution of random effects (given their hyper-prior and the available data) is exactly proportional to a multivariate normal distribution.�(It is a convenient approximation in other cases)

Skaug & Fournier (2006), Thorson & Minto (2015)

14 of 23

15 of 23

16 of 23

17 of 23

18 of 23

19 of 23

20 of 23

21 of 23

22 of 23

23 of 23

Recommended Reading

Bolker et al. (2008). Generalized linear mixed models: a practical guide for ecology and evolution. TREE: 24: 127-35.

Pinheiro, J.C. & Bates, D.M. (2000). Mixed-Effects Models in S and S-PLUS. New York: Springer-Verlag.

Skaug, H. J., & Fournier, D. A. (2006). Automatic approximation of the marginal likelihood in non-gaussian hierarchical models. Computational Statistics & Data Analysis, 51(2), 699-709.

Thorson, J. T., & Minto, C. (2014). Mixed effects: a unifying framework for statistical modelling in fisheries biology. ICES Journal of Marine Science: Journal du Conseil, fsu213.

Venables, W. N., & Dichmont, C. M. (2004). GLMs, GAMs and GLMMs: an overview of theory for applications in fisheries research. Fisheries Research, 70(2), 319-337.

Zuur et al. (2009). Mixed-effects Models and Extensions in Ecology with R. New York: Springer-Verlag.