TS001
Stata 11 Stata ts (ARMA) ARCH/GARCH whitepaper mwp 3 mwp-083 arch ARCH 11 mwp-051 arch postestimation 27 mwp-056 arima ARMA 35 mwp-003 arima postestimation 49 mwp-055 corrgram/ac/pac 56 mwp-009 dfgls DF-GLS 62 mwp-053 dfuller ADF 67 mwp-052 pperron P-P 73 mwp-054 tsset 77 mwp-002 / 83 mwp-001 StataCorp c 2011 Math c 2011 StataCorp LP Math web: www.math-koubou.jp email: master@math-koubou.jp
mwp-083 Stata arima, arch / whitepaper mwp-003, mwp-051, whitepaper VAR/VEC mwp-084 1. 2. 3. 4. 5. 6. ARCH 7. tsset 1. (1) y 1, y 2,..., y T (stochastic process) {y t } = {..., y 1, y 0, y 1,...} (1) {y t } 3 {y t} (stationary) (weakly stationary) (covariance stationary) (i) E(y t ) t (ii) V (y t ) t (iii) Cov(y t, y t s ) t s(s > 0) c Copyright Math c Copyright StataCorp LP (used with permission) 3
(2) (white noise) {u t } E(u t ) = 0 (2a) V (u t ) = σ 2 (2b) Cov(u t, u s ) = 0, t s (2c) 0 (σ 2 ) 2. (1) AR(p) p (autoregressive process) *1 y t = ϕ 1 y t 1 + ϕ 2 y t 2 + + ϕ p y t p + ϵ t, ϵ t WN(whitenoise) (3) (2) MA(q) q (moving average process) y t = ϵ t + θ 1 ϵ t 1 + + θ q ϵ t q, ϵ t WN (4) (3) ARMA(p, q) (p, q) (autoregressive-moving average process) AR(p) MA(q) y t = ϕ 1 y t 1 + ϕ 2 y t 2 + + ϕ p y t p + ϵ t + θ 1 ϵ t 1 + + θ q ϵ t q, ϵ t WN (5) L ϕ(l) = (1 ϕ 1 L ϕ 2 L 2 ϕ p L p ) θ(l) = (1 + θ 1 L + θ 2 L 2 + + φ q L q ) (6a) (6b) AR(p), MA(q), ARMA(p, q) AR(p) ϕ(l)y t = ϵ t (7a) MA(q) y t = θ(l)ϵ t (7b) ARMA(p, q) ϕ(l)y t = θ(l)ϵ t (7c) *1 [TS] arima p54 ϕ ρ 4
3. 4. 5. 6. ARCH 7. tsset 5
mwp-051 arch - ARCH arch ARCH, GARCH ARCH (volatility) 1. ARCH 2. ARCH/GARCH 3. ARCH/GARCH ARMA 4. EGARCH 5. PGARCH 6. 1. ARCH ARCH (autoregressive conditional heteroskedasticity) [TS] arch p12 (1) y t (conditional mean equation) σt 2 (conditional variance equation) A B ARCH, GARCH [TS] arch p12-13 (2) (3) arch 20 2. ARCH/GARCH Example wpi1.dta ARCH/GARCH. use http://www.stata-press.com/data/r11/wpi1 * 1 (wholesale price index) 1960q1 1990q4 ln wpi ln(wpi) c Copyright Math c Copyright StataCorp LP (used with permission) *1 File Example Datasets Stata 11 manual datasets Time-Series Reference Manual [TS] arch 6
. list if n <= 4 n >= ( N - 3), separator(4) * 2 wpi t ln_wpi 1. 30.7 1960q1 3.424263 2. 30.8 1960q2 3.427515 3. 30.7 1960q3 3.424263 4. 30.7 1960q4 3.424263 121. 111 1990q1 4.70953 122. 110.8 1990q2 4.707727 123. 112.8 1990q3 4.725616 124. 116.2 1990q4 4.755313 D.ln wpi ln wpi 1. twoway (line D.ln wpi t), yline(0) * 3 postestimation estat archlm [R] regress postestimation time series Engle LM (Lagrange Multiplier test) ARCH D.ln wpi *2 Data Describe data List data *3 Graphics Twoway graph (scatter, line, etc.) 7
. regress D.ln wpi * 4. regress D.ln_wpi Source SS df MS Number of obs = 123 F( 0, 122) = 0.00 Model 0 0. Prob > F =. Residual.02521709 122.000206697 R squared = 0.0000 Adj R squared = 0.0000 Total.02521709 122.000206697 Root MSE =.01438 D.ln_wpi Coef. Std. Err. t P> t [95% Conf. Interval] _cons.0108215.0012963 8.35 0.000.0082553.0133878 estat estat archlm Statistics Postestimation Reports and statistics estat : Reports and statistics: Test for ARCH effects in the residuals (archlm) Specify a list of lag orders to be tested: 1 1 estat archlm. estat archlm, lags(1) LM test for autoregressive conditional heteroskedasticity (ARCH) lags(p) chi2 df Prob > chi2 1 8.366 1 0.0038 H0: no ARCH effects vs. H1: ARCH(p) disturbance p 0.0038 ARCH *4 Statistics Linear models and related Linear regression 8
ARCH GARCH(1, 1) D.ln wpi y t ARCH(1) { yt = x t β + ϵ t (M1) σt 2 = γ 0 + γ 1 ϵ 2 t 1 GARCH(1, 1) { yt = x t β + ϵ t σ 2 t = γ 0 + γ 1 ϵ 2 t 1 + δ 1 σ 2 t 1 (M2) GARCH(1, 1) ARCH GARCH [TS] arch p24-25 Statistics Time series ARCH/GARCH ARCH and GARCH models Model : Dependent variable: D.ln wpi Specify maximum lags: ARCH maximum lag: 1 GARCH maximum lag: 1 2 arch - Model 9
. arch D.ln_wpi, arch(1/1) garch(1/1) (setting optimization to BHHH) Iteration 0: log likelihood = 355.2346 Iteration 1: log likelihood = 365.64589 Iteration 2: log likelihood = 366.89266 Iteration 3: log likelihood = 369.652 Iteration 4: log likelihood = 370.42566 (switching optimization to BFGS) Iteration 5: log likelihood = 372.41702 Iteration 6: log likelihood = 373.11099 Iteration 7: log likelihood = 373.18939 Iteration 8: log likelihood = 373.23277 Iteration 9: log likelihood = 373.23394 Iteration 10: log likelihood = 373.23397 ARCH family regression Sample: 1960q2 1990q4 Number of obs = 123 Distribution: Gaussian Wald chi2(.) =. Log likelihood = 373.234 Prob > chi2 =. OPG D.ln_wpi Coef. Std. Err. z P> z [95% Conf. Interval] ln_wpi ARCH _cons.0061167.0010616 5.76 0.000.0040361.0081974 arch L1..4364123.2437428 1.79 0.073.0413147.9141394 garch L1..4544606.1866605 2.43 0.015.0886126.8203085 _cons.0000269.0000122 2.20 0.028 2.97e 06.0000508 arch (M2) β 0 = 0.0061 γ 0 = 0.000 γ 1 = 0.436 δ 1 = 0.454 γ 1 p 0.073 0 10
3. ARCH/GARCH ARMA 4. EGARCH 5. PGARCH 6. 11
mwp-003 arima - arima (ARMA: autoregressive moving-average) arima ARMA ARMAX 1. ARMA 2. arima 2.1 ARIMA(1,1,1) 2.2 2.3 2.4 ARMAX 1. ARMA ARMA [TS] arima Introduction p54 ARMA(1, 1) µ t ρµ t 1 θϵ t 1 t ϵ t 1 µ t, ϵ t ρ θ p q ARMA(p, q) ARMA(p, q) µ t = y t x t β (M1) µ t = ρ 1 µ t 1 + + ρ p µ t p + θ 1 ϵ t 1 + + θ q ϵ t q + ϵ t (M2) (M2) (M1) L c Copyright Math c Copyright StataCorp LP (used with permission) 12
ARMA x t ARMA(1, 1) ARMA(2, 2) (1) ARMA(1, 1) ARMA(p, q) (1 ρ 1 L)(y t β 0 ) = (1 + θ 1 L)ϵ t y t β 0 ρ 1 (y t 1 β 0 ) = ϵ t + θ 1 ϵ t 1 y t β 0 = ρ 1 (y t 1 β 0 ) + θ 1 ϵ t 1 + ϵ t (M3) ARMA(1, 1) (2) ARMA(2, 2) ARMA(2, 2) y t β 0 = ρ 1 (y t 1 β 0 ) + ρ 2 (y t 2 β 0 ) + θ 1 ϵ t 1 + θ 2 ϵ t 2 + ϵ t (M4) ARIMA(p, d, q) I integrated d ARMA(p, q) 2. arima 2.1 ARIMA(1,1,1) (wholesale price index) Example wpi1.dta. use http://www.stata-press.com/data/r11/wpi1 * 1 1960q1 1990q4. list wpi t if n <= 4 n >= ( N - 3), separator(4) * 2 *1 File Example Datasets Stata 11 manual datasets Time-Series Reference Manual [TS] arima *2 Data Describe data List data 13
wpi t 1. 30.7 1960q1 2. 30.8 1960q2 3. 30.7 1960q3 4. 30.7 1960q4 121. 111 1990q1 122. 110.8 1990q2 123. 112.8 1990q3 124. 116.2 1990q4 wpi D.wpi wpi 1. twoway (line wpi t), title(wpi) * 3. twoway (line D.wpi t), yline(0) title(d.wpi) wpi D.wpi ARMA arima arima(p,d,q) ar(), ma() 2 AR 1 p MA 1 q 1 4 numlist ar(), ma() arima(p,d,q) d arima(1,1,1) D.wpi wpi *3 Graphics Twoway graph (scatter, line, etc.) 14
arima(p,d,q) arima wpi Statistics Time series ARIMA and ARMAX models Model : Dependent variable: wpi ARIMA(p,d,q) specification: p = d = q = 1 1 arima Model. arima wpi, arima(1,1,1) (setting optimization to BHHH) Iteration 0: log likelihood = 139.80133 Iteration 1: log likelihood = 135.6278 Iteration 2: log likelihood = 135.41838 Iteration 3: log likelihood = 135.36691 Iteration 4: log likelihood = 135.35892 (switching optimization to BFGS) Iteration 5: log likelihood = 135.35471 Iteration 6: log likelihood = 135.35135 Iteration 7: log likelihood = 135.35132 Iteration 8: log likelihood = 135.35131 ARIMA regression Sample: 1960q2 1990q4 Number of obs = 123 Wald chi2(2) = 310.64 Log likelihood = 135.3513 Prob > chi2 = 0.0000 15
OPG D.wpi Coef. Std. Err. z P> z [95% Conf. Interval] wpi ARMA _cons.7498197.3340968 2.24 0.025.0950019 1.404637 ar L1..8742288.0545435 16.03 0.000.7673256.981132 ma L1..4120458.1000284 4.12 0.000.6080979.2159938 /sigma.7250436.0368065 19.70 0.000.6529042.7971829 (M3) wpi t 0.750 = 0.874 ( wpi t 1 0.750) 0.412 ϵ t 1 + ϵ t sigma 0.725 ϵ ar(), ma() arima D.wpi Statistics Time series ARIMA and ARMAX models Model : Dependent variable: D.wpi Supply list of ARMA lags: List of AR lags: 1 List of MA lags: 1 2 arima Model 16
. arima D.wpi, ar(1) ma(1) ARIMA(1, 1, 1) [TS] arima postestimation (mwp-055 ) 2.2 2.3 2.4 ARMAX 17