29
Lecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 – Lecture 14 August 13, 2014 V

Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Lecture 14Bayesian Models for Spatio-Temporal Data

Dennis SunStats 253

August 13, 2014

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 2: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Outline of Lecture

1 Recap of Bayesian Models

2 Empirical Bayes

3 Case 1: Long-Lead Forecasting of Sea Surface Temperatures

4 Case 2: Modeling and Forecasting the Eurasian Dove Invasion

5 Case 3: Mediterranean Surface Vector Winds

6 Wrapping Up the Course

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 3: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Recap of Bayesian Models

Where are we?

1 Recap of Bayesian Models

2 Empirical Bayes

3 Case 1: Long-Lead Forecasting of Sea Surface Temperatures

4 Case 2: Modeling and Forecasting the Eurasian Dove Invasion

5 Case 3: Mediterranean Surface Vector Winds

6 Wrapping Up the Course

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 4: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Recap of Bayesian Models

Bayesian Models

• Bayesian models differ from frequentist models only in that theparameters θ are random.

• This allows us to stack priors to create hierarchical models.

• The Gibbs sampler is a universal algorithm that allows us to efficientlysample from the posterior in hierarchical models.

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 5: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Recap of Bayesian Models

Example: Rater Model

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 6: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Recap of Bayesian Models

Computations

• The Gibbs sampler provides samples from the posterior.

• We can use these samples to estimate the posterior distribution (e.g.,histogram) or the posterior mean.

• JAGS will automatically simulate from the posterior.

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 7: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Recap of Bayesian Models

Results for the Rater Model

I put priors on γk and δ` so that I could do inference on them.

Posterior of gamma, student 1

Fre

quen

cy

−3 −2 −1 0

050

010

0015

00

Posterior of gamma, student 2

Fre

quen

cy

−2.5 −1.5 −0.5 0.5 1.0

050

010

0015

00

Posterior of gamma, student 3

Fre

quen

cy

−1 0 1 2

050

010

0015

00

Posterior of gamma, student 4

Fre

quen

cy

−1.0 0.0 0.5 1.0 1.5 2.0 2.5

050

010

0015

00

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 8: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Empirical Bayes

Where are we?

1 Recap of Bayesian Models

2 Empirical Bayes

3 Case 1: Long-Lead Forecasting of Sea Surface Temperatures

4 Case 2: Modeling and Forecasting the Eurasian Dove Invasion

5 Case 3: Mediterranean Surface Vector Winds

6 Wrapping Up the Course

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 9: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Empirical Bayes

What would a frequentist do?

• Remember: In the Bayesian framework, to perform inference on aparameter, you must put a prior on it. Otherwise, you must specify itsvalue beforehand.

• Example: Suppose there are 3 sections of a class taught by differentprofessors. Let yij denote the final exam score of student j in class i.

• yij∣∣θi ∼ N(θi, σ

2) (instructor effect)• θi ∼ N(µ, τ2)

• Maybe we can instead try to estimate hyperparameters such as µ andτ2 from the data, then use N(µ, τ2) as the prior.

• What would our estimates of the parameters be then?

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 10: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Empirical Bayes

Empirical Bayes

• The idea of estimating hyperparameters from the data is calledempirical Bayes.

• It is ultimately a frequentist method because we don’t need to specifya prior on the hyperparameters we estimate!

• We get hierarchical models without subjective priors! Is this too goodto be true?

• What are the challenges of doing this in practice?

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 11: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Case 1: Long-Lead Forecasting of Sea Surface Temperatures

Where are we?

1 Recap of Bayesian Models

2 Empirical Bayes

3 Case 1: Long-Lead Forecasting of Sea Surface Temperatures

4 Case 2: Modeling and Forecasting the Eurasian Dove Invasion

5 Case 3: Mediterranean Surface Vector Winds

6 Wrapping Up the Course

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 12: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Case 1: Long-Lead Forecasting of Sea Surface Temperatures

Problem Setup

• El Nino is characterized by warmer sea surface temperatures (SST) inthe equatorial Pacific Ocean.

• Therefore, to predict El Nino, one needs to forecast the SST severalmonths in advance.

• We observe the average monthly SST at different locations in thePacific:

ztdef= (zt(s1), ...,zt(sm))

• Want to forecast SSTs τ months in advance: zT+τ .

• This analysis is taken from Berliner, Wikle, and Cressie (2000).

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 13: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Case 1: Long-Lead Forecasting of Sea Surface Temperatures

First Model: Linear Dynamical Model

State model: yt+τ = Φyt + εt εt ∼ N(0,Σ)

Data model: zt = Ayt + δt δt ∼ N(0, σ2I)

• A contains the first k principal components of the empiricalcovariance matrix over the spatial locations.

• yt represents weights on those PCs.

• Unknown parameters are Φ,Σ, σ2. Need to put priors on all of these:

vec(Φ) ∼ N(vec(0.9I), 100I)

Σ−1 ∼Wishart

(1

100(k − 1)I, k − 1

)σ2 ∼ InverseGaussian(0.1, 100)

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 14: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Case 1: Long-Lead Forecasting of Sea Surface Temperatures

First Model: Linear Dynamical Model

1997 1998

2.5% and 97.5% quantiles of posterior

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 15: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Case 1: Long-Lead Forecasting of Sea Surface Temperatures

Second Model: “Non-Linear” Model

State model: yt+τ = Φtyt + εt εt ∼ N(0,Σ)

Data model: zt = Ayt + δt δt ∼ N(0, σ2I)

• Allow Φt = Φ(It, Jt) to vary with time.• It classifies the current regime as “cool”, “normal”, or “warm”.

Obtained by thresholding the Southern Oscillation Index (SOI):

It =

0 if SOIt < low threshold

1 if SOIt in between

2 if SOIt > upper threshold

• Jt is obtained by similarly thresholding a latent process Wt:

Wt|β, τ2 ∼ N(xTt β, τ2)

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 16: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Case 1: Long-Lead Forecasting of Sea Surface Temperatures

Second Model: “Non-Linear” Model

1997 1998

2.5% and 97.5% quantiles of posterior

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 17: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Case 2: Modeling and Forecasting the Eurasian Dove Invasion

Where are we?

1 Recap of Bayesian Models

2 Empirical Bayes

3 Case 1: Long-Lead Forecasting of Sea Surface Temperatures

4 Case 2: Modeling and Forecasting the Eurasian Dove Invasion

5 Case 3: Mediterranean Surface Vector Winds

6 Wrapping Up the Course

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 18: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Case 2: Modeling and Forecasting the Eurasian Dove Invasion

Problem Setup

• The Eurasian Collared Dove (ECD) was first observed in NorthAmerica in the 80s and are now spreading quickly throughout thecontinent.

• They pose a threat to native ecosystems, so we would like to forecasttheir spread.

• Observe zt(si): number of doves observed at location si.

• This analysis is taken from Hooten, Wikle, Dorazio, and Royle (2007).

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 19: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Case 2: Modeling and Forecasting the Eurasian Dove Invasion

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 20: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Case 2: Modeling and Forecasting the Eurasian Dove Invasion

The Model

Data model: zt(si)∣∣ yt(si), π ∼ Bin(yt(si), π)

yt∣∣ λt ∼ Pois(Hλt)

State model: λt = B(α)G(λt−1;θ)λt−1

• π is the probability of observing an animal. Not estimable from thisdata alone, but the authors estimated it using data collected on arelated species.

• G is a diagonal matrix that models growth, while B modelsdispersion.

• The authors go on to put priors on α and θ.

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 21: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Case 2: Modeling and Forecasting the Eurasian Dove Invasion

Results

Posterior means for years in sample

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 22: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Case 2: Modeling and Forecasting the Eurasian Dove Invasion

Results

Posterior means for future years

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 23: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Case 3: Mediterranean Surface Vector Winds

Where are we?

1 Recap of Bayesian Models

2 Empirical Bayes

3 Case 1: Long-Lead Forecasting of Sea Surface Temperatures

4 Case 2: Modeling and Forecasting the Eurasian Dove Invasion

5 Case 3: Mediterranean Surface Vector Winds

6 Wrapping Up the Course

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 24: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Case 3: Mediterranean Surface Vector Winds

Problem Setup

• The goal is to predict wind speeds and directions at differentlocations over the Mediterranean.

• (xt(si), yt(si)) is the vector indicating the wind speed in the x- andy-directions.

• We assume that xt and yt are noisy measurements of underlyingstates ut and vt.

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 25: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Case 3: Mediterranean Surface Vector Winds

Data on February 1, 2005

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 26: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Case 3: Mediterranean Surface Vector Winds

A Physical State Model

• The state model is movtivated by the Rayleigh friction equations:

∂u

∂t− fv = − 1

ρ0

∂p

∂x− γu ∂v

∂t+ fu = − 1

ρ0

∂p

∂y− γv.

where u, v are the east-west and north-south components, p is thesea-level pressure, and the rest are (unknown) parameters.

• An approximate solution to these equations is given by

u ≈ − f

ρ0(f2 + γ2)

∂p

∂y− γ

ρ0(f2 + γ2)

∂p

∂x− 2

γ

ρ0(f2 + γ2)

∂u

∂t− 1

ρ0(f2 + γ2)

∂2p

∂x∂t

v ≈ f

ρ0(f2 + γ2)

∂p

∂x− γ

ρ0(f2 + γ2)

∂p

∂y− 2

γ

ρ0(f2 + γ2)

∂v

∂t− 1

ρ0(f2 + γ2)

∂2p

∂y∂t

• We can discretize this as follows:

ut = a1Dypt + a2Dxpt + a3ut−1 + a4Dxpt−1

vt = b1Dxpt + b2Dypt + b3vt−1 + b4Dypt−1

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 27: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Case 3: Mediterranean Surface Vector Winds

Results for February 2, 2005

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 28: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Wrapping Up the Course

Where are we?

1 Recap of Bayesian Models

2 Empirical Bayes

3 Case 1: Long-Lead Forecasting of Sea Surface Temperatures

4 Case 2: Modeling and Forecasting the Eurasian Dove Invasion

5 Case 3: Mediterranean Surface Vector Winds

6 Wrapping Up the Course

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt

Page 29: Lecture 14 Bayesian Models for Spatio-Temporal DataLecture 14 Bayesian Models for Spatio-Temporal Data Dennis Sun Stats 253 August 13, 2014 Dennis Sun Stats 253 { Lecture 14 August

Wrapping Up the Course

A Few Last Thoughts

• The analysis of spatial and temporal data is really the analysis ofcorrelated data.

• “Model the mean function, use spatial and temporal methods tomodel the residual.”

• There are two main ways to capture correlations: model thecorrelation directly (e.g., kriging) and via autoregressions.

• Many methods that work well for time series (e.g., Kalman filter)break down in space because the data are no longer ordered.

Thanks for a great quarter!

Dennis Sun Stats 253 – Lecture 14 August 13, 2014 Vskip0pt