Dr Łukasz Goczek Uniwersytet Warszawski
Dane krótko i długookresowe stopy procentowe Co wiemy z teorii? Krótkookresowe stopy powodują stopami długookresowymi (toteż taka jest idea bezpośredniego celu inflacyjnego i współczesnej polityki pieniężnej). Zatem krótkookresowa stopa jest równa długookresowej plus oczekiwania dotyczące inflacji. Do tego stopnia uznane za prawdziwe, że w zasadzie w ten sposób wylicza się oczekiwania inflacyjne.
Dane krótko i długookresowe stopy procentowe interestrates.dta g lprime=ln(prime) g ltbonds=ln(tbonds) Pamiętad: tsset określić wymiar czasu tsfill uzupełnić dane Najlepiej najpierw obejrzed dane: twoway (tsline lprime ltbonds)
Dane krótko i długookresowe stopy procentowe INTRESTRATES.DTA summarize Variable Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- date 591 4960.995 5197.251-4017 13939 tbonds 591 6.295804 2.811131 2.19 14.14 prime 591 7.170237 3.647031 2 20.5 year 591 1973.127 14.22968 1949 1998 month 591 6.477157 3.461518 1 12 -------------+-------------------------------------------------------- t 591 296 170.7513 1 591 lprime 591 1.842837.5152965.6931472 3.020425 ltbonds 591 1.733909.4735195.7839016 2.649008
.5 1 1.5 2 2.5 3 0 200 400 600 t lprime ltbonds
reg lprime ltbonds Source SS df MS Number of obs = 591 -------------+------------------------------ F( 1, 589) = 6466.42 Model 143.584447 1 143.584447 Prob > F = 0.0000 Residual 13.0785292 589.022204634 R-squared = 0.9165 -------------+------------------------------ Adj R-squared = 0.9164 Total 156.662976 590.265530468 Root MSE =.14901 lprime Coef. Std. Err. t P> t [95% Conf. Interval] -------------+---------------------------------------------------------------- ltbonds 1.041813.0129556 80.41 0.000 1.016368 1.067258 _cons.0364276.0232851 1.56 0.118 -.0093043.0821596
Corrgram lprime LAG AC PAC Q Prob>Q [Autocorrelation] [Partial Autocor] - 1 0.9928 0.9933 585.44 0.0000 ------- ------- 2 0.9826-0.5329 1159.9 0.0000 ------- ---- 3 0.9714 0.1394 1722.3 0.0000 ------- - 4 0.9599-0.0143 2272.5 0.0000 ------- 5 0.9488 0.0968 2810.9 0.0000 ------- 6 0.9380-0.0310 3338 0.0000 ------- 7 0.9276 0.0642 3854.3 0.0000 ------- 8 0.9172-0.0868 4360.1 0.0000 ------- 9 0.9063-0.0982 4854.7 0.0000 ------- 10 0.8947-0.0105 5337.5 0.0000 ------- 11 0.8827 0.0349 5808.3 0.0000 ------- 12 0.8705-0.0255 6267 0.0000 ------ 13 0.8582-0.0405 6713.5 0.0000 ------ 14 0.8454-0.0783 7147.7 0.0000 ------ 15 0.8321-0.0509 7569 0.0000 ------ 16 0.8185 0.0273 7977.4 0.0000 ------ 17 0.8047-0.0395 8372.7 0.0000 ------ 18 0.7908 0.0704 8755.1 0.0000 ------ 19 0.7773 0.0344 9125.3 0.0000 ------ 20 0.7646 0.1047 9484.1 0.0000 ------
ac lprime -0.50 0.00 0.50 1.00 0 10 20 30 40 Lag Bartlett's formula for MA(q) 95% confidence bands
xcorr lprime ltbonds -1.00-0.50 0.00 0.50 1.00-1.00-0.50 0.00 0.50 1.00 Cross-correlogram -20-10 0 10 20 Lag
bgodfrey Breusch-Godfrey LM test for autocorrelation --------------------------------------------------------------------------- lags(p) chi2 df Prob > chi2 -------------+------------------------------------------------------------- 1 544.698 1 0.0000 --------------------------------------------------------------------------- H0: no serial correlation. dwstat Durbin-Watson d-statistic( 2, 591) =.0744556
est clear reg lprime ltbonds eststo OLS newey lprime ltbonds, lag(12) eststo NEWEY prais lprime ltbonds eststo PRAIS esttab OLS NEWEY PRAIS
------------------------------------------------------------ (OLS) (NEWEY) (PRAIS) ------------------------------------------------------------ ltbonds 1.042*** 1.042*** 0.431*** (80.41) (24.63) (8.35) _cons 0.0364 0.0364 1.026*** (1.56) (0.53) (6.21) ------------------------------------------------------------ N 591 591 591 ------------------------------------------------------------ t statistics in parentheses p<0.05, ** p<0.01, *** p<0.001
Przedstawione estymatory są estymatorami uogólnionymi, ale są one dośd restrykcyjne - pozwalają one tylko na zaburzenia autokorelacji pierwszego rzędu. Mimo, że mają pewne wartości pedagogiczne i historyczne, są one nieco przestarzałe.
arima lprime ltbonds, ar(1) ma(1) Sample: 1-591 Number of obs = 591 Wald chi2(3) = 115927.77 Log likelihood = 1204.738 Prob > chi2 = 0.0000 OPG lprime Coef. Std. Err. z P> z [95% Conf. Interval] -------------+---------------------------------------------------------------- lprime ltbonds.2932401.0481496 6.09 0.000.1988686.3876116 _cons 1.214718.2264527 5.36 0.000.7708789 1.658557 -------------+---------------------------------------------------------------- ARMA ar L1..994627.0029675 335.18 0.000.9888109 1.000443 ma L1..5334454.0252282 21.14 0.000.483999.5828918 -------------+---------------------------------------------------------------- /sigma.031359.0004968 63.12 0.000.0303853.0323327
quietly reg lprime ltbonds estat archlm LM test for autoregressive conditional heteroskedasticity (ARCH) --------------------------------------------------------------------------- lags(p) chi2 df Prob > chi2 -------------+------------------------------------------------------------- 1 451.862 1 0.0000 --------------------------------------------------------------------------- H0: no ARCH effects vs. H1: ARCH(p) disturbance
arch lprime ltbonds, arch(2) garch(1) ARCH family regression Sample: 1-591 Number of obs = 591 Distribution: Gaussian Wald chi2(1) = 13565.14 Log likelihood = 470.0994 Prob > chi2 = 0.0000 OPG lprime Coef. Std. Err. z P> z [95% Conf. Interval] -------------+---------------------------------------------------------------- lprime ltbonds.8699349.0074692 116.47 0.000.8552955.8845742 _cons.2957079.0132623 22.30 0.000.2697142.3217016 -------------+---------------------------------------------------------------- ARCH arch L2. 1.100418.1263028 8.71 0.000.8528694 1.347967 garch L1. -.0884711.0514038-1.72 0.085 -.1892207.0122786 _cons.0021665.0003777 5.74 0.000.0014262.0029069
ARCH (Engle 1982) arch() GARCH (Bollerslev 1986) arch() garch() ARCH-in-mean (Engle, Lilien, and Robins 1987) archm arch() [garch()] GARCH with ARMA terms arch() garch() ar() ma() EGARCH (Nelson 1991) earch() egarch() TARCH, threshold ARCH (Zakoian 1994) abarch() atarch() sdgarch() GJR, form of threshold ARCH (Glosten, Jagannathan, and Runkle 1993) arch() tarch() [garch()] SAARCH, simple asymmetric ARCH (Engle 1990) arch() saarch() [garch()] PARCH, power ARCH (Higgins and Bera 1992) parch() [pgarch()] NARCH, nonlinear ARCH narch() [garch()] NARCHK, nonlinear ARCH with one shift narchk() [garch()] A-PARCH, asymmetric power ARCH (Ding, Granger, and Engle 1993) aparch() [pgarch()] NPARCH, nonlinear power ARCH nparch() [pgarch()]
Korekta autokorelacji i heteroskedastyczności kładzie nacisk na modelowanie błędu kosztem statycznej specyfikacji tego, co chcielibyśmy policzyd. To jest złe rozłożenie priorytetów. Najczęściej interesuje nas przyczynowośd (kto zabił, dlaczego zabił), która jest o wiele ważniejsza niż cyzelowanie wyrażenia błędu (jak do tej pory policja myliła się określając zabójcę).
Granger i Newbold twierdzą: każde dwie zmienne z trendem oszacowane razem w modelu dają fałszywe wrażenie przyczynowości. Odwrotne stwierdzenie jest również prawdziwe: nie można nie zaobserwowad braku zależności statystycznej pomiędzy dwoma szeregami z trendem! Regresja jednej zmiennej z trendem na drugiej zmiennej z trendem zatem wykazuje fałszywą istotnośd.
Kolejnośd zmiennych jest wazna jesli potem chcemy stosowac dekompozycje Cholesky ego. Testy Grangera.
net install gcause gcause ltbonds lprime, lags (12) exog( _Imonth_*) Granger causality test Sample: 13 to 591 obs = 579 H0: lprime does not Granger-cause ltbonds F( 12, 543) = 1.59 Prob > F = 0.0908 chi2(12) = 20.33 (asymptotic) Prob > chi2 = 0.0612 (asymptotic)
net install gcause gcause lprime ltbonds, lags (12) exog( _Imonth_*) Granger causality test Sample: 13 to 591 obs = 579 H0: ltbonds does not Granger-cause lprime F( 12, 543) = 10.19 Prob > F = 0.0000 chi2(12) = 130.37 (asymptotic) Prob > chi2 = 0.0000 (asymptotic)
W przypadku szeregów stacjonarnych mamy pojęcie równowagi, czyli jest pewien poziom, do którego szereg wydaje się powracad w razie szoku. Założyliśmy, że zintegrowane szeregi nie mają równowagi. To nie jest tak. Tak naprawdę nie mają tylko STAŁEJ równowagi. Teraz możemy zauważyd, że zintegrowane szeregi danych dążą do równowagi, która jest w ruchu. Jest to zbiór wartości, określane przez niektórych x. Zatem jest to ponownie poziom, do którego szereg wydaje się powracad w razie szoku. Tylko ten poziom nie jest stały w czasie. Powiemy zatem, że x wyznacza poziom docelowy (wyznacza cel) dla y.
net install gcause gcause lprime ltbonds, lags (12) exog( _Imonth_*) Granger causality test Sample: 13 to 591 obs = 579 H0: ltbonds does not Granger-cause lprime F( 12, 543) = 10.19 Prob > F = 0.0000 chi2(12) = 130.37 (asymptotic) Prob > chi2 = 0.0000 (asymptotic)
Dfuller, pperon (o tym za chwilę oba szeregi zintegrowane pierwszego stopnia) Potencjalne równanie kointegrujące: reg ltbonds lprime Zapis reszt: predict resid, r Test stacjonarności reszt: dfuller resid Model korekty błędów: reg d.ltbonds d.lprime l.resid
dfuller lprime Dickey-Fuller test for unit root Number of obs = 590 ---------- Interpolated Dickey-Fuller --------- Test 1% Critical 5% Critical 10% Critical Statistic Value Value Value Z(t) -2.200-3.430-2.860-2.570 MacKinnon approximate p-value for Z(t) = 0.2063 dfuller ltbonds Dickey-Fuller test for unit root Number of obs = 590 ---------- Interpolated Dickey-Fuller --------- Test 1% Critical 5% Critical 10% Critical Statistic Value Value Value Z(t) -1.831-3.430-2.860-2.570 MacKinnon approximate p-value for Z(t) = 0.3654
dfuller d.lprime Dickey-Fuller test for unit root Number of obs = 589 ---------- Interpolated Dickey-Fuller --------- Test 1% Critical 5% Critical 10% Critical Statistic Value Value Value Z(t) -13.348-3.430-2.860-2.570 MacKinnon approximate p-value for Z(t) = 0.0000 dfuller d.ltbonds Dickey-Fuller test for unit root Number of obs = 589 ---------- Interpolated Dickey-Fuller --------- Test 1% Critical 5% Critical 10% Critical Statistic Value Value Value Z(t) -17.109-3.430-2.860-2.570 MacKinnon approximate p-value for Z(t) = 0.0000
reg ltbonds lprime Source SS df MS Number of obs = 591 -------------+------------------------------ F( 1, 589) = 6466.42 Model 121.246358 1 121.246358 Prob > F = 0.0000 Residual 11.0438426 589.018750157 R-squared = 0.9165 -------------+------------------------------ Adj R-squared = 0.9164 Total 132.290201 590.224220679 Root MSE =.13693 ltbonds Coef. Std. Err. t P> t [95% Conf. Interval] -------------+---------------------------------------------------------------- lprime.8797336.01094 80.41 0.000.8582473.9012198 _cons.1127035.0209328 5.38 0.000.0715915.1538155 predict resid, r
dfuller resid Dickey-Fuller test for unit root Number of obs = 590 ---------- Interpolated Dickey-Fuller --------- Test 1% Critical 5% Critical 10% Critical Statistic Value Value Value Z(t) -3.239-3.430-2.860-2.570 MacKinnon approximate p-value for Z(t) = 0.0178
Test Dickey Fullera zakłada model regresji: Model szacowany jest przy użyciu MNK. To oczywiście problem przy autokorelacji. Test Augumented Dickey-Fuller dokłada opóźnienia, aby to uwzględnid. Test Phillipsa i Perrona można rozumied jak test Dickey Fullera, który jest odporny na autokorelację poprzez użycie estymatora wariancji-kowariancji Neweya Westa (1987)
Test odporny bardziej wiarygodny. Kilka wariantów, dotyczących hipotez odnośnie integracji danych:
pperron resid, regress Phillips-Perron test for unit root Number of obs = 590 Newey-West lags = 5 ---------- Interpolated Dickey-Fuller --------- Test 1% Critical 5% Critical 10% Critical Statistic Value Value Value Z(rho) -29.296-20.700-14.100-11.300 Z(t) -3.820-3.430-2.860-2.570 MacKinnon approximate p-value for Z(t) = 0.0027
dfgls resid DF-GLS for resid Number of obs = 572 Maxlag = 18 chosen by Schwert criterion DF-GLS tau 1% Critical 5% Critical 10% Critical [lags] Test Statistic Value Value Value 18-2.730-3.480-2.824-2.540 17-2.729-3.480-2.827-2.543 16-2.710-3.480-2.830-2.546 15-2.740-3.480-2.833-2.549 14-2.875-3.480-2.836-2.551 13-2.732-3.480-2.839-2.554 12-2.563-3.480-2.842-2.557 11-2.615-3.480-2.845-2.560 10-2.617-3.480-2.848-2.562 9-2.677-3.480-2.851-2.565 8-2.825-3.480-2.853-2.567 7-2.588-3.480-2.856-2.569 6-2.623-3.480-2.859-2.572 5-2.720-3.480-2.861-2.574 4-2.788-3.480-2.864-2.576 3-3.078-3.480-2.866-2.579 2-2.959-3.480-2.869-2.581 1-3.699-3.480-2.871-2.583 Opt Lag (Ng-Perron seq t) = 13 with RMSE.0334897 Min SC = -6.732904 at lag 2 with RMSE.033942 Min MAIC = -6.732505 at lag 4 with RMSE.0337776
reg d.ltbonds d.lprime l.resid Source SS df MS Number of obs = 590 -------------+------------------------------ F( 2, 587) = 31.94 Model.047473864 2.023736932 Prob > F = 0.0000 Residual.43630744 587.000743284 R-squared = 0.0981 -------------+------------------------------ Adj R-squared = 0.0951 Total.483781304 589.00082136 Root MSE =.02726 D.ltbonds Coef. Std. Err. t P> t [95% Conf. Interval] -------------+---------------------------------------------------------------- lprime D1..2344281.0296649 7.90 0.000.1761658.2926905 resid L1. -.0167115.0082658-2.02 0.044 -.0329456 -.0004774 _cons.0009698.0011247 0.86 0.389 -.0012392.0031788
1. Zastanawiamy się, czy tradycja Boxa-Jenkinsa (modelowania błędu) czy Grangera-Newbolda-Simsa. 2. Testujemy czy szeregi są niestacjonarne testem DF, jeżeli nie jesteśmy pewni testem PP (silniejszy). 3. Sprowadzamy do tego samego poziomu integracji (pamiętajmy o sensie, czy jest sens?) 4. Regresja zależności kointegrującej (długookresowej) 5. Test stacjonarności reszt z regresji. 6. Oszacowanie modelu z korektą błędów.
Dziękuję za uwagę.