analysis of nonstationary time series: monte carlo
TRANSCRIPT
Analysis of Nonstationary Time Series:
Monte Carlo simulations on spurious regression
Kaiji Motegi∗
3rd Quarter 2019, Kobe University
1 Description
In this note, we run Monte Carlo simulations in order to better understand spurious regression. Let
ϵyt, ϵxti.i.d.∼ N(0, 1). Consider four cases of data generating processes (DGPs):
Case 1. {yt} follows random walk (RW) yt = yt−1 + ϵyt and {xt} follows RW xt = xt−1 + ϵxt.
Case 2. {yt} follows RW yt = yt−1 + ϵyt and {xt} follows random walk with drift (RW-D) xt =
0.2 + xt−1 + ϵxt.
Case 3. {yt} follows RW-D yt = 0.1 + yt−1 + ϵyt and {xt} follows RW xt = xt−1 + ϵxt.
Case 4. {yt} follows RW-D yt = 0.1 + yt−1 + ϵyt and {xt} follows RW-D xt = 0.2 + xt−1 + ϵxt.
For each case we draw J = 5000 Monte Carlo samples with sample size n ∈ {100, 500, 1000}. For each
Monte Carlo sample, we run a regression model yt = α+ βxt + ut and compute ordinary least squares(OLS) estimator β̂, t-statistic t̂β , and R2.
In Figures 1-4, we draw histograms of β̂, t̂β , and R2 over J = 5000 Monte Carlo samples. Somequantities diverge or converge as n → ∞, and others neither diverge nor converge.
In Figures 5-8, histograms of properly scaled β̂, t̂β , and R2 are plotted.
∗Tenure-track associate professor, Graduate School of Economics, Kobe University.E-mail: [email protected] Website: http://www2.kobe-u.ac.jp/˜motegi/
1
Figure 1: Histograms in Case 1 ({yt} is RW and {xt} is RW)
β̂ (n = 100) β̂ (n = 500) β̂ (n = 1000)
t̂β (n = 100) t̂β (n = 500) t̂β (n = 1000)
R2 (n = 100) R2 (n = 500) R2 (n = 1000)
We simulate J = 5000 Monte Carlo samples from random walk yt = yt−1 + ϵyt and random walk xt =
xt−1+ ϵxt, where ϵyt, ϵxti.i.d.∼ N(0, 1). Sample size is n ∈ {100, 500, 1000}. For each Monte Carlo sample,
we run a regression model yt = α + βxt + ut and compute OLS estimator β̂, t-statistic t̂β , and R2. Thisfigure presents histograms of each of those quantities over J = 5000 Monte Carlo samples.
2
Figure 2: Histograms in Case 2 ({yt} is RW and {xt} is RW-D)
β̂ (n = 100) β̂ (n = 500) β̂ (n = 1000)
t̂β (n = 100) t̂β (n = 500) t̂β (n = 1000)
R2 (n = 100) R2 (n = 500) R2 (n = 1000)
We simulate J = 5000 Monte Carlo samples from random walk yt = yt−1 + ϵyt and random walk with drift
xt = 0.2 + xt−1 + ϵxt, where ϵyt, ϵxti.i.d.∼ N(0, 1). Sample size is n ∈ {100, 500, 1000}. For each Monte
Carlo sample, we run a regression model yt = α+βxt+ut and compute OLS estimator β̂, t-statistic t̂β , andR2. This figure presents histograms of each of those quantities over J = 5000 Monte Carlo samples.
3
Figure 3: Histograms in Case 3 ({yt} is RW-D and {xt} is RW)
β̂ (n = 100) β̂ (n = 500) β̂ (n = 1000)
t̂β (n = 100) t̂β (n = 500) t̂β (n = 1000)
R2 (n = 100) R2 (n = 500) R2 (n = 1000)
We simulate J = 5000 Monte Carlo samples from random walk with drift yt = 0.1+ yt−1+ ϵyt and random
walk xt = xt−1 + ϵxt, where ϵyt, ϵxti.i.d.∼ N(0, 1). Sample size is n ∈ {100, 500, 1000}. For each Monte
Carlo sample, we run a regression model yt = α+βxt+ut and compute OLS estimator β̂, t-statistic t̂β , andR2. This figure presents histograms of each of those quantities over J = 5000 Monte Carlo samples.
4
Figure 4: Histograms in Case 4 ({yt} is RW-D and {xt} is RW-D)
β̂ (n = 100) β̂ (n = 500) β̂ (n = 1000)
t̂β (n = 100) t̂β (n = 500) t̂β (n = 1000)
R2 (n = 100) R2 (n = 500) R2 (n = 1000)
We simulate J = 5000 Monte Carlo samples from random walk with drift yt = 0.1+ yt−1+ ϵyt and random
walk with drift xt = 0.2 + xt−1 + ϵxt, where ϵyt, ϵxti.i.d.∼ N(0, 1). Sample size is n ∈ {100, 500, 1000}.
For each Monte Carlo sample, we run a regression model yt = α+ βxt + ut and compute OLS estimator β̂,t-statistic t̂β , and R2. This figure presents histograms of each of those quantities over J = 5000 Monte Carlosamples.
5
Figure 5: Histograms of scaled quantities in Case 1 ({yt} is RW and {xt} is RW)
β̂ (n = 100) β̂ (n = 500) β̂ (n = 1000)
n−1/2t̂β (n = 100) n−1/2t̂β (n = 500) n−1/2t̂β (n = 1000)
R2 (n = 100) R2 (n = 500) R2 (n = 1000)
We simulate J = 5000 Monte Carlo samples from random walk yt = yt−1 + ϵyt and random walk xt =
xt−1+ ϵxt, where ϵyt, ϵxti.i.d.∼ N(0, 1). Sample size is n ∈ {100, 500, 1000}. For each Monte Carlo sample,
we run a regression model yt = α + βxt + ut and compute OLS estimator β̂, t-statistic t̂β , and R2. Thisfigure presents histograms of each of those quantities scaled properly over J = 5000 Monte Carlo samples.
6
Figure 6: Histograms of scaled quantities in Case 2 ({yt} is RW and {xt} is RW-D)
n1/2β̂ (n = 100) n1/2β̂ (n = 500) n1/2β̂ (n = 1000)
n−1/2t̂β (n = 100) n−1/2t̂β (n = 500) n−1/2t̂β (n = 1000)
R2 (n = 100) R2 (n = 500) R2 (n = 1000)
We simulate J = 5000 Monte Carlo samples from random walk yt = yt−1 + ϵyt and random walk with drift
xt = 0.2 + xt−1 + ϵxt, where ϵyt, ϵxti.i.d.∼ N(0, 1). Sample size is n ∈ {100, 500, 1000}. For each Monte
Carlo sample, we run a regression model yt = α+βxt+ut and compute OLS estimator β̂, t-statistic t̂β , andR2. This figure presents histograms of each of those quantities scaled properly over J = 5000 Monte Carlosamples.
7
Figure 7: Histograms of scaled quantities in Case 3 ({yt} is RW-D and {xt} is RW)
n−1/2β̂ (n = 100) n−1/2β̂ (n = 500) n−1/2β̂ (n = 1000)
n−1/2t̂β (n = 100) n−1/2t̂β (n = 500) n−1/2t̂β (n = 1000)
R2 (n = 100) R2 (n = 500) R2 (n = 1000)
We simulate J = 5000 Monte Carlo samples from random walk with drift yt = 0.1+ yt−1+ ϵyt and random
walk xt = xt−1 + ϵxt, where ϵyt, ϵxti.i.d.∼ N(0, 1). Sample size is n ∈ {100, 500, 1000}. For each Monte
Carlo sample, we run a regression model yt = α+βxt+ut and compute OLS estimator β̂, t-statistic t̂β , andR2. This figure presents histograms of each of those quantities scaled properly over J = 5000 Monte Carlosamples.
8
Figure 8: Histograms of scaled quantities in Case 4 ({yt} is RW-D and {xt} is RW-D)
n1/2(β̂ − 0.5) (n = 100) n1/2(β̂ − 0.5) (n = 500) n1/2(β̂ − 0.5) (n = 1000)
n−1t̂β (n = 100) n−1t̂β (n = 500) n−1t̂β (n = 1000)
n(1−R2) (n = 100) n(1−R2) (n = 500) n(1−R2) (n = 1000)
We simulate J = 5000 Monte Carlo samples from random walk with drift yt = 0.1+ yt−1+ ϵyt and random
walk with drift xt = 0.2 + xt−1 + ϵxt, where ϵyt, ϵxti.i.d.∼ N(0, 1). Sample size is n ∈ {100, 500, 1000}.
For each Monte Carlo sample, we run a regression model yt = α + βxt + ut and compute OLS estimatorβ̂, t-statistic t̂β , and R2. This figure presents histograms of each of those quantities scaled properly overJ = 5000 Monte Carlo samples.
9