# Chapter 38 Activity 18: Spatially Continuous Data IV

*NOTE*: The source files for this book are available with companion package {isdas}. The source files are in Rmarkdown format and packed as templates. These files allow you execute code within the notebook, so that you can work interactively with the notes.

## 38.1 Practice questions

Answer the following questions:

- What does “Best” in BLUP mean?
- What is the advantage of kriging over other interpolation approaches?
- How is the the autocovariance used to produce optimal predictions?

## 38.2 Learning objectives

In this activity, you will:

Conduct variograpic analysis.

Use kriging to interpolate a field.

## 38.3 Suggested reading

- Bailey TC and Gatrell AC (1995) Interactive Spatial Data Analysis, Chapters 5 and 6. Longman: Essex.
- Bivand RS, Pebesma E, and Gomez-Rubio V (2008) Applied Spatial Data Analysis with R, Chapter 8. Springer: New York.
- Brunsdon C and Comber L (2015) An Introduction to R for Spatial Analysis and Mapping, Chapter 6, Sections 6.7 and 6.8. Sage: Los Angeles.
- Isaaks EH and Srivastava RM (1989) An Introduction to Applied Geostatistics, Chapter 12. Oxford University Press: Oxford.
- O’Sullivan D and Unwin D (2010) Geographic Information Analysis, 2nd Edition, Chapters 9 and 10. John Wiley & Sons: New Jersey.

## 38.4 Preliminaries

It is good practice to clear the working space to make sure that you do not have extraneous items there when you begin your work. The command in R to clear the workspace is `rm`

(for “remove”), followed by a list of items to be removed. To clear the workspace from *all* objects, do the following:

`rm(list = ls())`

Note that `ls()`

lists all objects currently on the workspace.

Load the libraries you will use in this activity (load other packages as appropriate).

```
library(isdas)
library(gstat)
library(sf)
library(tidyverse)
library(stars)
```

Load dataset:

`data("aquifer")`

The data is a set of piezometric head (watertable pressure) observations of the Wolfcamp Aquifer in Texas (https://en.wikipedia.org/wiki/Hydraulic_head). Measures of pressure can be used to infer the flow of underground water, since water flows from high to low pressure areas.

These data were collected to evaluate potential flow of contamination related to a high level toxic waste repository in Texas. The Deaf Smith county site in Texas was one of three potential sites proposed for this repository. Beneath the site is a deep brine aquifer known as the Wolfcamp aquifer that may serve as a conduit of contamination leaking from the repository.

The data set consists of 85 georeferenced measurements of piezometric head. Possible applications of interpolation are to determine sites at risk and to quantify uncertainty of the interpolated surface, to evaluate the best locations for monitoring stations.

Convert to a `SpatialPointsDataFrame`

:

```
<- aquifer %>%
aquifer.sf st_as_sf(coords = c("X", "Y"),
remove = FALSE)
```

## 38.5 Activity

**Capstone Activity**

This is a capstone activity where you can work free-style on a data set of your choice, and put in practice what you have learned with respect to the analysis of spatially continuous/ field data.

Partner with a fellow student to analyze the dataset provided.

Use kriging to interpolate the underlying field. Justify your modeling choices.

Discuss your results.

Imagine that you had to compare different modeling approaches (e.g., kriging, IDW). Propose a protocol to decide which method is more accurate.

*Spatial Econometrics: Methods and Models*. Book. Dordrecht: Kluwer.

*Geographical Analysis*27: 93–115.

*Spatial Point Patterns: Methodology and Applications with r*. Book. Chapman; Hall/CRC.

*Interactive Spatial Data Analysis*. Book. Essex: Addison Wesley Longman.

*Applied Spatial Data Analysis with r*. Book. New York: Springer Science+Business Media.

*Geographical Analysis*28 (4): 281–98. ISI:A1996VL03500001.

*An Introduction to r for Spatial Analysis and Mapping*. Book. Sage.

*Statistics for Spatial Data*. Book. Wiley Series in Probability and Mathematical Statistics. New York: John Wiley & Sons.

*Journal of Geographical Systems*9 (4): 371–96. C:/Papers/Journal of Geographical Systems/Journal of Geographical Systems (2007) 9 (4) 371-396.pdf.

*Geographical Analysis*31 (4): 340–58.

*Geographical Analysis*24 (3): 189–206. ISI:A1992JF93400001 C:/Papers/Geographical Analysis/Geographical Analysis (1992) 24 (3) 189-206.pdf.

*Scandinavian Journal of Statistics*, 359–73.

*Advanced Spatial Statistics: Special Topics in the Exploration of Quantitative Spatial Data Series*. Book. Dordrecht: Kluwer.

*Journal of Vegetation Science*6 (4): 575–82.

*Spatial Data Analysis in the Social and Environmental Sciences*. Book. Cambridge: Cambridge University Press.

*Applied Geostatistics*. Book. New York: Oxford University Press.

*Local Models for Spatial Analysis*. CRC press.

*Geocomputation with r*. Book. CRC Press.

*Statistical Rethinking: A Bayesian Course with Examples in r and Stan*. Book. Vol. 122. CRC Press.

*An Introduction to Statistical Problem Solving in Geography*. Book. 2nd. Edition. Long Grove, Illinois: Waveland Press.

*International Regional Science Review*26 (2): 208–17. ISI:000181958400007 C:/Papers/International Regional Science Review/International Regional Science Review (2003) 26 (2) 208-217.pdf.

*Statistical Inference and Simulation for Spatial Point Processes*. Chapman; Hall/CRC.

*Geographic Information Analysis*. Book. 2nd. Edition. Hoboken, New Jersey: John Wiley & Sons.

*Environment and Planning A*43 (12): 2992–3010. https://doi.org/10.1068/a44111.

*Urban Studies*45 (8): 1565–81. https://doi.org/10.1177/0042098008091491.

*Spatial Data Analysis in Ecology and Agriculture Using r*. Book. cRc Press.

*Journal of Geographical Systems*11 (2): 191–207. ISI:000266249500007.

*Journal of Applied Probability*13 (2): 255–66. ISI:A1976CA37400007.

*A Map Algebra*. Harvard Graduate School of Design Cambridge, MA.

*Annals of the Association of American Geographers*102 (6): 1290–1309. https://doi.org/10.1080/00045608.2012.685044.

*R Packages: Organize, Test, Document, and Share Your Code*. " O’Reilly Media, Inc.".

*Tidyverse: Easily Install and Load the ’Tidyverse’*. https://CRAN.R-project.org/package=tidyverse.

*R for Data Science: Import, Tidy, Transform, Visualize, and Model Data*. " O’Reilly Media, Inc.".

*Oikos*, 219–29.

### References

*Interactive Spatial Data Analysis*. Book. Essex: Addison Wesley Longman.

*Applied Spatial Data Analysis with r*. Book. New York: Springer Science+Business Media.

*An Introduction to r for Spatial Analysis and Mapping*. Book. Sage.

*Applied Geostatistics*. Book. New York: Oxford University Press.

*Geographic Information Analysis*. Book. 2nd. Edition. Hoboken, New Jersey: John Wiley & Sons.