26
Lecture 11 More about Kriging Dennis Sun Stats 253 July 28, 2014 Dennis Sun Stats 253 – Lecture 11 July 28, 2014 V

Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Lecture 11More about Kriging

Dennis SunStats 253

July 28, 2014

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 2: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Outline of Lecture

1 Kriging and Isotropy

2 Kriging for Spatio-Temporal Data

3 Other Interpretations of Kriging

4 Wrapping Up

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 3: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Kriging and Isotropy

Where are we?

1 Kriging and Isotropy

2 Kriging for Spatio-Temporal Data

3 Other Interpretations of Kriging

4 Wrapping Up

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 4: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Kriging and Isotropy

Isotropy

Covariance Function: Σ(s, s′)

• Original problem: covariance between y(s) and y(s′) can be“anything”.

• Stationarity: covariance only depends on difference between points:

Σ(s, s′) = C(s− s′)

• Isotropy: covariance only depends on distance between points:

Σ(s, s′) = C(||s− s′||)

• How did isotropy help us when kriging?

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 5: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Kriging and Isotropy

Examining for (An)isotropy

Calculate separate variograms for different directions.sample.vgm <- variogram(snow_wet ~ elevation + latitude, data=data,

alpha=c(0,45,90,135))

distance

sem

ivar

ianc

e

500

1000

1500

2000

2500

0.5 1.0 1.5 2.0

●●

● ●●

0

●●

45

● ●●

● ●

90

0.5 1.0 1.5 2.0

500

1000

1500

2000

2500

● ● ●●

● ● ●● ●

● ● ●

135

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 6: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Kriging and Isotropy

Isotropy seems reasonable on the snowpack data

distance

sem

ivar

ianc

e

500

1000

1500

2000

2500

0.5 1.0 1.5 2.0

●●

● ●●

0

●●

45

● ●●

● ●

90

0.5 1.0 1.5 2.0

500

1000

1500

2000

2500

● ● ●●

● ● ●● ●

● ● ●

135

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 7: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Kriging and Isotropy

What if isotropy is not reasonable?

Can construct anisotropic covariance as a shear of isotropic one.

0.02

0.02

0.02

0.02

0.04

0.06

0.08

0.1

0.12

0.14

R◦T=⇒

0.1

0.1

0.2

0.2

0.3

0.3

0.4

0.5

0.6

0.7

0.8

0.9

Can(s− s′) = Cis(T−1R−1(s− s′))

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 8: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Kriging for Spatio-Temporal Data

Where are we?

1 Kriging and Isotropy

2 Kriging for Spatio-Temporal Data

3 Other Interpretations of Kriging

4 Wrapping Up

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 9: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Kriging for Spatio-Temporal Data

A Warning

• This section is going to be extremely boring.

• Kriging in space-time is pretty much exactly the same as kriging inspace, with an extra dimension.

• Is 2 + 1 = 3? (For spatio-temporal kriging, more or less.)

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 10: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Kriging for Spatio-Temporal Data

Definitions

• We now observe y(s, t).

• The covariance function is now

Σ((s, t), (s′, t′)) = E[y(s, t)y(s′, t′)

]− µ(s, t)µ(s′, t′).

• Stationarity means

Σ((s, t), (s′, t′)) = C(s− s′, t− t′).

• How should isotropy be defined?

• Should probably keep isotropy in space separate from isotropy in time.

Σ((s, t), (s′, t′)) = C(||s− s′||, |t− t′|).

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 11: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Kriging for Spatio-Temporal Data

Separability

Assume stationarity.

−11 −10 −9 −8 −7 −6

0 2

0 4

0 6

0 8

010

0

51

52

53

54

55

56

long

latda

y

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●RPTVALROS

KILSHABIR

DUBCLA MULCLOBEL

MAL

Irish wind data

• Easiest way is to assume aseparable model:

C(r, h) = CS(r)CT (h)

• Suggests we can fit covariancefunction to spatial and temporalcomponents separately:

C(r, h) = CS(r)CT (h)

• Fully symmetric:

C(r, h) = C(r,−h)

Is this reasonable? (Consider awind that blows west.)

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 12: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Kriging for Spatio-Temporal Data

Non-Separable Covariances

• Gneiting (2002) proposes class of functions:

C(r, h) =σ2

(|h|2γ + 1)τexp

[−c||r||2γ

(|h|2γ + 1)βγ

].

Strength of spatio-temporal correlation governed by β.

• Another approach is to take a weighted combination of covariancefunctions (De Iaco et al, 2001):

C(r, h) = w0CS(r)CT (h) + w1CS(r) + w2CT (h).

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 13: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Kriging for Spatio-Temporal Data

Summary of Spatio-Temporal Kriging

• For data in continuous space and time, it pretty much the only gamein town.

• How often do you have continuous observations over both space andtime anyway? Typically, you observe snapshots of spatial data atdiscrete times.

• If time is discrete, then we can model the temporal component using,e.g., AR process.

• Next class: how to do this. (Hint: it involves the Kalman filter.)

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 14: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Other Interpretations of Kriging

Where are we?

1 Kriging and Isotropy

2 Kriging for Spatio-Temporal Data

3 Other Interpretations of Kriging

4 Wrapping Up

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 15: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Other Interpretations of Kriging

Kriging as Function Estimation

• Recall the kriging estimator

y0 = Σy0yΣ−1yyy.

• We can think of y0 as a function

y(s0) = Σ(s0, S)Σ(S, S)−1y

where S =[s1 · · · sn

].

• Another way to write this is

y(s0) =

n∑i=1

ciΣ(s0, si)

where c = Σ(S, S)−1y.

• We call Σ(·, si) a kernel function.

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 16: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Other Interpretations of Kriging

Kriging as Function Estimation

●●

●●

●●

−0.5 0.0 0.5

0.0

0.5

1.0

1.5

2.0

2.5

3.0

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 17: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Other Interpretations of Kriging

Kriging and Interpolation

y(·) =

n∑i=1

ciΣ(·, si) f(·) =

n∑i=1

ciK(·, si)

• We have n unknowns ci, i = 1, ..., n.

• We also have n constraints. What are they?

• Recall that y(si) = E(y(si)|y) = y(si).

• So f has to pass through the n points.

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 18: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Other Interpretations of Kriging

Kriging and Interpolation

●●

●●

●●

●● ●

●●

−0.5 0.0 0.5

−4

−2

02

4

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 19: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Other Interpretations of Kriging

Kriging and Interpolation

●●

●●

●●

−0.5 0.0 0.5

0.0

0.5

1.0

1.5

2.0

2.5

3.0

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 20: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Other Interpretations of Kriging

One Application: Integration

Let’s look at an application of this kind of interpolation:

• Suppose we want to integrate a function f , but we don’t know f . Weonly observe it at a few points: f(xi) for i = 1, ..., n.

• Idea: Interpolate points, then integrate interpolated function f .

• What happens? Suppose∫K(x,x′) dx = 1 for any x′.∫

f(x) dx =

∫ n∑i=1

ciK(x,xi) dx =

n∑i=1

ci

• So to integrate, we just need to compute weights ci and sum them.No numerical integration involved!

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 21: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Other Interpretations of Kriging

Adding Observation Noise

• Suppose we actually observe z(si) = y(si) + δi, where δi ∼ N(0, τ2).

• This changes the kriging estimator slightly

y0 = Σy0y(Σyy + τ2I)−1y

y(·) =

n∑i=1

ciΣ(·, si)

where ci = (Σ(S, S) + τ2I)−1y.

• Now our data is generated from the Gaussian process model:

y(·) ∼ GP (0,Σ(·, ·))z(si) = y(si) + δi, i = 1, ..., n.

and y is the posterior mean, i.e., y(·) = E(y(·)|z(s1), ..., z(sn)).

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 22: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Other Interpretations of Kriging

Connection to Kernel Methods

• You might hear machine learning people talk about “kernel methods”or “kernel machines.”

• All this means is that they are modeling f =∑ciK(·,xi).

• They might say, “It allows us to estimate functions overhigh-dimensional spaces without doing computations in that space.”All this means is calculating

y(s0) = Σ(s0, S)Σ(S, S)−1y

doesn’t depend on the dimension of s0.

• They might even say, “This allows us to map our data to aninfinite-dimensional space....” You should probably just walk away.

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 23: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Wrapping Up

Where are we?

1 Kriging and Isotropy

2 Kriging for Spatio-Temporal Data

3 Other Interpretations of Kriging

4 Wrapping Up

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 24: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Wrapping Up

Summary

• The isotropy assumption reduces a high-dimensional problem to a1-dimensional one.

• Kriging extends in a straightforward way to space-time, but modelsare a bit disappointing.

• Kriging is essentially an interpolation method.

• Kernel methods (machine learning) are just kriging.

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 25: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Wrapping Up

Next Week

• No lectures Monday and Wednesday. (All of us will be away at theJoint Statistical Meetings in Boston.)

• Project presentations during scheduled workshops next Thursday andFriday.

• Good chance to get feedback on your work before you turn it in.

• We’ll distribute sign-up sheets. We’ll supply refreshments.

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt

Page 26: Lecture 11 More about Kriging - Stanford University · 2014-07-30 · Kriging extends in a straightforward way to space-time, but models are a bit disappointing. Kriging is essentially

Wrapping Up

Homeworks

• Homework 4a and 4b are now both posted. They are due in twoweeks.

• Make sure you download the latest versions of both files. (There weresome updates over the weekend.)

• You only need to do one of them. (You are welcome to do both; youmust do both if you missed an earlier homework.)

• They are very different but about the same difficulty. Should take lesstime than Homework 3.

• Homework 4a has an extra credit portion.

Dennis Sun Stats 253 – Lecture 11 July 28, 2014 Vskip0pt