Linear Prediction for Spatial and Spatio-Temporal Fields

36-467/36-667

25 September 2018

\[ \newcommand{\Expect}[1]{\mathbb{E}\left[ #1 \right]} \newcommand{\Var}[1]{\mathrm{Var}\left[ #1 \right]} \newcommand{\SampleVar}[1]{\widehat{\mathrm{Var}}\left[ #1 \right]} \newcommand{\Cov}[1]{\mathrm{Cov}\left[ #1 \right]} \newcommand{\TrueRegFunc}{\mu} \newcommand{\EstRegFunc}{\widehat{\TrueRegFunc}} \DeclareMathOperator{\tr}{tr} \DeclareMathOperator*{\argmin}{argmin} \DeclareMathOperator{\det}{det} \newcommand{\TrueNoise}{\epsilon} \newcommand{\EstNoise}{\widehat{\TrueNoise}} \]

In our previous episode

Optimal linear prediction for spatial data

\[\begin{eqnarray} \EstRegFunc(r_0) & = & \alpha + \vec{\beta} \cdot \left[\begin{array}{c} X(r_1) \\ X(r_2) \\ \vdots \\ X(r_n) \end{array}\right]\\ \alpha & = & \Expect{X(r_0)} - \vec{\beta} \cdot \left[\begin{array}{c} \Expect{X(r_1)}\\ \Expect{X(r_2)} \\ \vdots \\ \Expect{X(r_n)}\end{array}\right] ~ \text{(goes away if everything's centered)}\\ \vec{\beta} & = & {\left[\begin{array}{cccc} \Var{X(r_1)} & \Cov{X(r_1), X(r_2)} & \ldots & \Cov{X(r_1), X(r_n)}\\ \Cov{X(r_1), X(r_2)} & \Var{X(r_2)} & \ldots & \Cov{X(r_2), X(r_n)}\\ \vdots & \vdots & \ldots & \vdots\\ \Cov{X(r_1), X(r_n)} & \Cov{X(r_2), X(r_n)} & \ldots & \Var{X(r_n)}\end{array}\right]}^{-1} \left[\begin{array}{c} \Cov{X(r_0), X(r_1)}\\ \Cov{X(r_0), X(r_2)}\\ \vdots \\ \Cov{X(r_0), X(r_n)}\end{array}\right] \end{eqnarray}\]

This should look familiar

What do we need to know?

Expectation values

What about variance and covariance?

\[ \Cov{X(r), X(q)} = \Expect{X(r)X(q)} -\TrueRegFunc(r) \TrueRegFunc(q) = \Expect{(X(r)-\TrueRegFunc(r))(X(q) - \TrueRegFunc(q))} \]

Some restrictions on \(\Cov{X(r), X(q)}\)

Some restrictions on \(\Cov{X(r), X(q)}\)

Some restrictions on \(\Cov{X(r), X(q)}\)

Estimating a stationary covariance function

Think of the Irish wind data

What about Belfast?

Try a stationary, isotropic covariance

global.mean <- mean(wind.loc$MeanWind)
distances <- spDists(coordinates(wind.loc), longlat = TRUE)
c.rq <- outer(wind.loc$MeanWind - global.mean, wind.loc$MeanWind - global.mean, 
    "*")
rho.rq <- c.rq/var(wind.loc$MeanWind)

Try a stationary, isotropic covariance

plot(x = as.vector(distances), y = as.vector(rho.rq), xlab = "Distance (km)", 
    ylab = expression((x(r) - bar(x))(x(q) - bar(x))/sigma^2))
lines(smooth.spline(x = as.vector(distances), y = as.vector(rho.rq), cv = TRUE))
L.rough <- -log(0.14)/100
curve(exp(-L.rough * x), add = TRUE, col = "blue")
legend("topright", legend = c("Data", "Spline", "Exponential"), pch = c(1, NA, 
    NA), lty = c("blank", "solid", "solid"), col = c("black", "black", "blue"))

Try a stationary, isotropic covariance

Kriging

wind.prediction <- function(r, L) {
    fit <- c(fit = NA, se = NA)
    global.mean <- mean(wind.loc$MeanWind)
    global.var <- var(wind.loc$MeanWind)
    distances.to.r <- spDistsN1(pts = coordinates(wind.loc), pt = r, longlat = TRUE)
    distances.among.q <- spDists(coordinates(wind.loc), longlat = TRUE)
    corYZ <- exp(-L * distances.to.r)
    corZ <- exp(-L * distances.among.q)
    Z <- wind.loc$MeanWind
    fit["fit"] <- global.mean + (Z - global.mean) %*% solve(corZ) %*% corYZ
    fit["se"] <- sqrt(global.var - t(corYZ) %*% solve(corZ) %*% corYZ)
    return(fit)
}
wind.prediction(r = as.numeric(belfast.longlat), L = L.rough)
##      fit       se 
## 5.362427 1.358965

Spatio-temporal prediction

Summary

Backup: Some figures from Krige (1981)

“Typical gold inch-dwt [=concentration] trend surfaces in the Klerksdorp goldfield on the basis of two-dimensional moving averages [= kriging]… Moving averages of \(100 \times 100\) ft areas within a mined-out section of \(500\times 500\) ft” (p. 28, caption of fig. 21a)

Backup: Some figures from Krige (1981)

“Illustration of the agreement between auto-covariance patterns of gold values for 25, 50, 100, and 200-ft square ore units for a section of the Hartebeestfontein mine” (p. 23, caption of fig. 18)

Backup: Valid covariance functions

Backup: Parametric covariance (or correlation) estimation

Backup: Nonlinear least squares

Backup: Nonlinear least squares illustrated

Using optim:

rho.mse <- function(L) {
    mean((rho.rq - exp(-L * distances))^2)
}
L.optim <- optim(par = L.rough, fn = rho.mse, method = "BFGS")
L.optim$par
## [1] 0.02432098

so estimated correlation length is \(41 \mathrm{km}\) rather than initial guess of \(51 \mathrm{km}\)

Backup: Nonlinear least squares illustrated

Using nls:

nls(as.vector(rho.rq) ~ exp(-L * as.vector(distances)), start = list(L = L.rough))
## Nonlinear regression model
##   model: as.vector(rho.rq) ~ exp(-L * as.vector(distances))
##    data: parent.frame()
##       L 
## 0.02428 
##  residual sum-of-squares: 109.6
## 
## Number of iterations to convergence: 5 
## Achieved convergence tolerance: 3.649e-06

References

Batchelor, G. K. 1996. The Life and Legacy of G. I. Taylor. Cambridge, England: Cambridge University Press.

Gneiting, Tilmann, Marc G. Genton, and Peter Guttorp. 2007. “Geostatistical Space-Time Models, Stationarity, Separability, and Full Symmetry.” In Statistical Methods for Spatio-Temporal Systems, edited by Bärbel Finkenstädt, Leonhard Held, and Valerie Isham, 151–75. Boca Raton, Florida: Chapman; Hall/CRC.

Krige, D. G. 1981. “Lognormal-de Wijsian Geostatistics for Ore Evaluation,” South african institute of mining and metallurgy monograph series,. Joannesburg: South African Institute of Mining; Metallurgy. http://www.saimm.co.za/Conferences/Geostatistics/GeostatisticsI.pdf.