Semivariograms

Lecture 3: Kriging and parameter estimation In , it is common do describe random fields in Spatial and Image Analysis • terms of semivariograms instead of functions. For a random field X(s), the semivariogram is defined as • 1 (s, t)= V(X(s) X(t)) 2 and the is V(X(s) X(t)). David Bolin University of Gothenburg For an isotropic random field with covariance r(h), the • semivariogram is Gothenburg (h)=r(0) r(h) April 1, 2019 (exersice!)

Title page David Bolin

Gaussian random fields Matérn

ArandomfieldX(s) is Gaussian if (X(s ),...,X(s ))T has a • 1 n multivariate Gaussian distribution for each choice of s1,...,sn. X(s) is uniquely specified by • 1 The value µ(s)=E(X(s)),and 2 The r(s1, s2)=C(X(s1),X(s2)). X(s) is • 1 stationary if µ(s) µ and if r(s1, s2) depends only on the ⌘ separation between the locations, h = s s . 1 2 2 isotropic if µ(s) µ and if r(s1, s2) only depends on the ⌘ distance between the locations, h = s s . k 1 2k Examples of isotropic covariance functions: • 2 ⌫ 1 Matérn: r(h)= ⌫ 1 (h) K⌫ (h) (⌫)2 2 Exponential: r(h)=2 exp( h) 2 3 h 1 h3 3 Spherical: r(h)= (1 + 3 ),ifh ✓ and r(h)=0 2 ✓ 2 ✓  otherwise.

Title page David Bolin Title page David Bolin Some terminology Image analysis applications

Image reconstruction Noise reduction

Title page David Bolin Title page David Bolin

Statistical models including random fields Conditional distributions

For a multivariate Gaussian variable

We have measurements yi,...,yn taken at some spatial • X1 µ1 ⌃11 ⌃12 locations s1,...,sn. N , X2 ⇠ µ2 ⌃21 ⌃22 Given that we also have some explanatory variables ✓ ◆ ✓✓ ◆ ✓ ◆◆ • B1,...,BK , we use a model we have that

K 1 1 X2 X1 N(µ2 + ⌃21⌃11 (X1 µ1), ⌃22 ⌃21⌃11 ⌃12) Yi = Bk(si)k + X(si)+"i . | ⇠ Xk=1 where X(s) is a mean-zero Gaussian random field. If X2 represents a random field at some unobserved locations, and Questions: X1 the observations, the conditional mean • 1 How do we estimate the parameters of the model? 1 E(X X )=µ + ⌃ ⌃ (X µ ) 2 How can we perform prediction for an unobserved location s0? 2| 1 2 21 11 1 1 is often called the Kriging predictor.

Title page David Bolin Title page David Bolin Kriging prediction Covariates

Afirstideaistouselinearregressiontointerpolatethedata: Traditionally, one has separated between three cases • Simple kriging: µ(s)=B(s) is known. k • 2 Ordinary kriging: µ(s)= is unknown but constant. Y (s)= iBi(s)+"s, where "s are iid N(0, ) • i=1 Universal kriging: µ(s)=B(s) is unknown. X • Possible covariates • For ordinary and universal kriging, we have to estimate the mean-value together with the covariance parameters ✓ before Longitue Latitude Altitude computing the prediction.

So we have to East coast West coast Estimate the model parameters , 2, ✓ . • { e } Given the parameters, compute the kriging prediction. •

Title page David Bolin Example David Bolin

Example: US temperatures OLS estimate

Estimate the parameters using ordinary : • 1 ˆ =(B>B) B>Y,

where Bij = Bi(sj) and Yi = Y (si). Calculate the prediction Xˆ(s)= k ˆ B (s). • i=1 i i P

Mean summer temperatures (June-August) in the continental • US 1997 recorded at 250 weather stations. We want to estimate all US temperatures based on the . •

Example David Bolin Example David Bolin Residudals Regression parameters Update regression parameters using GLS: How do we test whether the prediction is reasonable? • If the model assumptions hold, the residuals Y (s) Xˆ(s) ˆ =(B ⌃ 1B) 1B ⌃ 1Y, • GLS > > should be independent identically distributed. Confidence interval for i:

I =(ˆ 1.96 V ) i i ± ii 1 1 p where V =(B>⌃ B) . OLS GLS Intercept 21.6317 20.4688 ⇤ ⇤ Longitude 1.2897 1.0022 ⇤ Latitude 2.6959 2.6845 ⇤ ⇤ Altitude 2.6693 4.2177 ⇤ ⇤ East coast 0.0952 0.0096 West coast 1.3064 1.0139 ⇤ ⇤

Example David Bolin Example David Bolin

Variogram estimate Kriging estimation The kriging estimator is 2 1 E(X(s) Y, ✓ˆ)=ˆµ(s)+r(⌃ + I) (Y Bˆ) | e K ˆ where ⌃ij = r(si, sj), ri = r(s, si), and µˆ = k=1 Bk(s)k. P

Example David Bolin Example David Bolin Kriging residuals

There is now less spatial structure in the residuals.

Example David Bolin

Empirical of residuals

Example David Bolin