@@ -24,9 +24,12 @@ variables.
2424
2525## Readings
2626
27- * The R Book p778-785 on Generalized Least Squares models with spatially
28- correlated errors
29- * Numerical Ecology in R, p228-238 on detecting spatial dependence.
27+ * Crawley (2007) The R Book, pp. 778-785 on Generalized Least Squares models with
28+ spatially correlated errors
29+ * Borcard et al. (2011) Numerical Ecology in R, pp. 228-238 on detecting spatial
30+ dependence.
31+ * Pinheiro and Bates (2000) Mixed-Effects Models in S and S-PLUS, pp. 249-267 on
32+ Fitting Extended Linear Mdoels with gls
3033* https://beckmw.wordpress.com/2013/01/07/breaking-the-rules-with-spatial-correlation/
3134
3235## Outline
@@ -336,18 +339,36 @@ error.
336339
337340Crawley (2014) provides a straightforward description of these methods and a
338341few examples. Pinheiro and Bates (2000) provide a more detailed discussion with
339- more examples and they provide a useful table and figure that is helpful when
340- deciding which error model to chose from:
342+ more examples and they provide a useful table and figure (below) that are helpful
343+ when deciding which error model to chose from:
341344
342345This is Table 5.2 from Pinheiro and Bates (2000) in which * s* is the spatial lag
343346and * rho* is the correlation parameter. This is a subset of the models
344347presented in Cressie (1993).
345348![ table] ( figures/isotropic_variogram_models_table.png )
346349
347- Graphically these models of spatial correlation can be visualized like this
348- (Figure 5.9 of Pinheiro and Bates 2000):
350+ Graphically these models of spatial correlation can be visualized using variogram
351+ plots (Figure 5.9 of Pinheiro and Bates 2000):
349352![ plots] ( figures/isotropic_variogram_models_plots.png )
350353
354+ When we visually examine a vagriogram it is often useful to note the following
355+ three features:
356+
357+ * ** nugget** - semivariance at a spatial lag of zero
358+ * ** range** - the degree of difference or semivariance between two spatially
359+ independent samples
360+ * ** sill** - the spatial distance at which samples are spatially independent (i.e.,
361+ variogram is flat)
362+
363+ Here is an illustration of these three terms:
364+ ![ variogram] ( figures/Schematic_variogram.png )
365+
366+ The nugget should in theory be zero because if two samples have no distance
367+ between them they should in theory be the same value, but in practice it is often
368+ necessary to have a positive valued nugget to accurately describe the spatial
369+ corelation function. Note that adding a nugget into a spatial model requires
370+ the addition of an extra parameter (i.e., an increase in model complexity).
371+
351372### Model fitting, interpretation, and comparison
352373
353374When we carried out ordinary regression we used the formula:
@@ -398,7 +419,7 @@ Generalized Linear Models (GLS).
398419
399420** Note:** GLS models are distinct from General Linear Models (GLM) because GLS
400421models are primarily concerned with modeling the covariance between samples
401- while still adhering to the standard Normal distribution assumption for
422+ while still adhering to the standard Normal (i.e., Gaussian) distribution assumption for
402423measurement error. In contract, GLMs are typically harnessed when the Normal
403424distribution is not appropriate and we wish to use a different distribution for
404425the error term such as Poisson or Binomial distributions. It is possible to
@@ -452,7 +473,7 @@ sum(vario_sr$variog * vario_sr$n.pairs) / sum(vario_sr$n.pairs)
452473var(res)
453474```
454475
455- Ok so far we've learned that substrate density does not seem to be influencing
476+ Ok, so far we've learned that substrate density does not seem to be influencing
456477richness spatially or otherwise and that there still remains autcorrelation in
457478richness. Let's examine the most common model of spatial (and temporal)
458479autocorrelation: the exponential model also know as Autoregressive 1 model or AR1.
@@ -474,7 +495,7 @@ plot(Variogram(sr_exp, resType='normalized', maxDist = max_dist))
474495# actually which is a bit surprising given the output of the raw residuals
475496
476497# let's look at the same model but with a nugget
477- sr_exp_nug <- update(sr_exp, corr=corExp(c(0.5, 0.1), form=~x + y, nugget=T))
498+ sr_exp_nug <- update(sr_exp, corr=corExp(form=~x + y, nugget=T))
478499# Notice above I had to put in starting values for the rate and nugget of the
479500# spatial model. I found that if I left those off the model did not converge.
480501# This may be due to the fact that the estimated value of the nugget is very
0 commit comments