Section 6 Ssc 389

16
Time Series and Dynamic Models Section 6 Dynamic Regression Model Carlos M. Carvalho The University of Texas at Austin 1

Transcript of Section 6 Ssc 389

Page 1: Section 6 Ssc 389

Time Series and Dynamic Models

Section 6Dynamic Regression Model

Carlos M. CarvalhoThe University of Texas at Austin

1

Page 2: Section 6 Ssc 389

Normal/Gamma

Quick review...

Let φ ∼ Ga(

n02 ,

d02

)and (X |φ) ∼ N(m,Cφ−1)

hence (φ|X ) ∼ Ga(

n12 ,

d12

)where

n1 = n0 + 1 and d1 = d0 +(X −m)2

C

Also,p(X ) ∝ [n0 + (X −m)2/R]−

n+12

so that X ∼ Tn0(m,R), where R = C(

d0n0

)

1

Page 3: Section 6 Ssc 389

Dynamic Regression Model

The Model:

yt = βtXt + εt

βt = βt−1 + wt

I εt ∼ N(0, σ2) and wt ∼ Tnt−1(0,Wt)

I Wt = Ct−1

(1−δ

δ

)I δ is the discount factor ∈ (0, 1)

Posterior at t − 1 :

(βt−1|Dt−1) ∼ Tnt−1(mt−1,Ct−1) (σ−2|Dt−1) ∼ Ga

(nt−1

2,dt−1

2

)

2

Page 4: Section 6 Ssc 389

Dynamic Regression Model

Priors at t :

(βt |Dt−1) ∼ Tnt−1(mt−1,Rt) (yt |Dt−1) ∼ Tnt−1(ft ,Qt)

whereRt = Ct−1/δ, ft = mt−1Xt , Qt = X 2

t Rt + St−1 and St−1 = dt−1

nt−1

Posteriors at t :

(βt |Dt) ∼ Tnt (mt ,Ct) (σ−2|Dt) ∼ Ga

(nt

2,dt

2

)where nt = nt−1 + 1, dt = dt−1 + St−1e

2t /Qt ,

mt = mt−1 + Atet Ct = RtSt/Qt

et = (yt − ft), At = XtRt/Qt and St = dtnt

3

Page 5: Section 6 Ssc 389

Example: APPL vs. MKTδ = 0.90

Posterior Mean (beta_t|D_t)

Time

m

0 100 200 300 400

0.0

0.5

1.0

1.5

2.0

2.5

3.0

4

Page 6: Section 6 Ssc 389

Example: APPL vs. MKTδ = 0.90

Posterior summary (sigma|D_t)

Time

d/n

0 100 200 300 400

510

1520

5

Page 7: Section 6 Ssc 389

Example: APPL vs. MKTδ = 0.95

Posterior Mean (beta_t|D_t)

Time

m

0 100 200 300 400

0.5

1.0

1.5

2.0

2.5

6

Page 8: Section 6 Ssc 389

Example: APPL vs. MKTδ = 0.95

Posterior summary (sigma|D_t)

Time

d/n

0 100 200 300 400

510

1520

7

Page 9: Section 6 Ssc 389

Example: APPL vs. MKTδ = 0.99

Posterior Mean (beta_t|D_t)

Time

m

0 100 200 300 400

1.0

1.5

2.0

2.5

8

Page 10: Section 6 Ssc 389

Example: APPL vs. MKTδ = 0.99

Posterior Mean (beta_t|D_t)

Time

m

0 100 200 300 400

1.0

1.5

2.0

2.5

9

Page 11: Section 6 Ssc 389

Example: APPL vs. MKTWe can compute the “model likelihood” for different values of δ...

p(δi |Dt) ∝ p(y1:T |δi ) =T∏

t=1

p(yt |Dt−1, δi )

0.95 0.96 0.97 0.98 0.99 1.00

-1474

-1473

-1472

-1471

-1470

max: delta = 0.9872

DEL

LikOUT

10

Page 12: Section 6 Ssc 389

Now let’s try the MCMC

The Model:

yt = βtXt + εt

βt = βt−1 + wt

I εt ∼ N(0, σ2) and wt ∼ N(0, ω2)

I σ−2 ∼ Ga(aσ2 ,

bσ2 )

I ω−2 ∼ Ga(aω2 ,

bω2 )

11

Page 13: Section 6 Ssc 389

Example: APPL vs. MKT

Time

mBeta

0 100 200 300 400

0.8

1.0

1.2

1.4

1.6

12

Page 14: Section 6 Ssc 389

Example: APPL vs. MKT

Time

mBeta

0 100 200 300 400

0.5

1.0

1.5

2.0

2.5

13

Page 15: Section 6 Ssc 389

Example: APPL vs. MKT

Time

Sigma2

0 200 400 600 800 1000

2224

2628

3032

Sigma2

PARS[, 1]

Density

22 24 26 28 30 32

0.00

0.05

0.10

0.15

0.20

Time

Omega2

0 200 400 600 800 1000

0.005

0.015

0.025

Omega2

PARS[, 2]

Density

0.005 0.010 0.015 0.020 0.025

020

4060

80120

14

Page 16: Section 6 Ssc 389

Homework

1. Replicate the dynamic regression example from section 6.I First make sure you can implement the closed-form solution

using discount factorsI evaluate the the model likelihood for different values of δ

2. Simulate, for different values of r , data from the AR(1) plusnoise model with α = 0 and β = 1. r = W /V the ratiobetween the variance in the evolution equation and thevariance in the observation equation. For the different choicesof r plot the time series generated and the smoothed posteriormean from the distribution of θt |DT .

3. Prove the result in slide 6 in Section 5.

15