TS002

Similar documents
Stata 11 Stata VAR VEC whitepaper mwp 4 mwp-084 var VAR 14 mwp-004 varbasic VAR 25 mwp-005 svar VAR 31 mwp-007 vec intro VEC 47 mwp-008 vec VEC 75 mwp

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 postestim

Stata11 whitepapers mwp-037 regress - regress regress. regress mpg weight foreign Source SS df MS Number of obs = 74 F(

% 10%, 35%( 1029 ) p (a) 1 p 95% (b) 1 Std. Err. (c) p 40% 5% (d) p 1: STATA (1). prtesti One-sample test of pr

Microsoft Word - 計量研修テキスト_第5版).doc

Stata 11 Stata ROC whitepaper mwp anova/oneway 3 mwp-042 kwallis Kruskal Wallis 28 mwp-045 ranksum/median / 31 mwp-047 roctab/roccomp ROC 34 mwp-050 s

第11回:線形回帰モデルのOLS推定

最小2乗法

Microsoft Word - 計量研修テキスト_第5版).doc

1 Stata SEM LightStone 4 SEM 4.. Alan C. Acock, Discovering Structural Equation Modeling Using Stata, Revised Edition, Stata Press 3.

Stata 11 whitepaper mwp 4 mwp mwp-028 / 41 mwp mwp mwp-079 functions 72 mwp-076 insheet 89 mwp-030 recode 94 mwp-033 reshape wide

1 Stata SEM LightStone 3 2 SEM. 2., 2,. Alan C. Acock, Discovering Structural Equation Modeling Using Stata, Revised Edition, Stata Press.

4.9 Hausman Test Time Fixed Effects Model vs Time Random Effects Model Two-way Fixed Effects Model

第13回:交差項を含む回帰・弾力性の推定

Rによる計量分析:データ解析と可視化 - 第3回 Rの基礎とデータ操作・管理

評論・社会科学 123号(P)☆/1.福田

: (EQS) /EQUATIONS V1 = 30*V F1 + E1; V2 = 25*V *F1 + E2; V3 = 16*V *F1 + E3; V4 = 10*V F2 + E4; V5 = 19*V99

こんにちは由美子です

卒業論文

1 I EViews View Proc Freeze

.. est table TwoSLS1 TwoSLS2 GMM het,b(%9.5f) se Variable TwoSLS1 TwoSLS2 GMM_het hi_empunion totchr

kubostat2018d p.2 :? bod size x and fertilization f change seed number? : a statistical model for this example? i response variable seed number : { i

untitled

こんにちは由美子です

seminar0220a.dvi

1 15 R Part : website:

03.Œk’ì

LA-VAR Toda- Yamamoto(1995) VAR (Lag Augmented vector autoregressive model LA-VAR ) 2 2 Nordhaus(1975) 3 1 (D2)

fiúŁÄ”s‘ê‡ÌŁª”U…−…X…N…v…„…~…A…•‡Ì ”s‘ê™´›ß…−…^†[…fiŠ‚ª›Âfl’«

<4D F736F F D20939D8C7689F090CD985F93C18EEA8D758B E646F63>

オーストラリア研究紀要 36号(P)☆/3.橋本

R による共和分分析 1. 共和分分析を行う 1.1 パッケージ urca インスツールする 共和分分析をするために R のパッケージ urca をインスツールする パッケージとは通常の R には含まれていない 追加的な R のコマンドの集まりのようなものである R には追加的に 600 以上のパッ

自由集会時系列part2web.key

Microsoft Word - 計量研修テキスト_第5版).doc

s = 1.15 (s = 1.07), R = 0.786, R = 0.679, DW =.03 5 Y = 0.3 (0.095) (.708) X, R = 0.786, R = 0.679, s = 1.07, DW =.03, t û Y = 0.3 (3.163) + 0

T rank A max{rank Q[R Q, J] t-rank T [R T, C \ J] J C} 2 ([1, p.138, Theorem 4.2.5]) A = ( ) Q rank A = min{ρ(j) γ(j) J J C} C, (5) ρ(j) = rank Q[R Q,

読めば必ずわかる 分散分析の基礎 第2版

k3 ( :07 ) 2 (A) k = 1 (B) k = 7 y x x 1 (k2)?? x y (A) GLM (k

201711grade2.pdf

以下の内容について説明する 1. VAR モデル推定する 2. VAR モデルを用いて予測する 3. グレンジャーの因果性を検定する 4. インパルス応答関数を描く 1. VAR モデルを推定する ここでは VAR(p) モデル : R による時系列分析の方法 2 y t = c + Φ 1 y t

Use R

日本内科学会雑誌第102巻第4号

Ł\”ƒ-2005

第90回日本感染症学会学術講演会抄録(I)

X X X Y R Y R Y R MCAR MAR MNAR Figure 1: MCAR, MAR, MNAR Y R X 1.2 Missing At Random (MAR) MAR MCAR MCAR Y X X Y MCAR 2 1 R X Y Table 1 3 IQ MCAR Y I

こんにちは由美子です

JFE.dvi

II (2011 ) ( ) α β û i R


σ t σ t σt nikkei HP nikkei4csv H R nikkei4<-readcsv("h:=y=ynikkei4csv",header=t) (1) nikkei header=t nikkei4csv 4 4 nikkei nikkei4<-dataframe(n

一般化線形 (混合) モデル (2) - ロジスティック回帰と GLMM

(p.2 ( ) 1 2 ( ) Fisher, Ronald A.1932, 1971, 1973a, 1973b) treatment group controll group (error function) 2 (Legendre, Adrian

第86回日本感染症学会総会学術集会後抄録(I)

磁性物理学 - 遷移金属化合物磁性のスピンゆらぎ理論

Solution Report

カルマンフィルターによるベータ推定( )


講義のーと : データ解析のための統計モデリング. 第5回

講義のーと : データ解析のための統計モデリング. 第3回

Microsoft Word - 表紙.docx

Stata User Group Meeting in Kyoto / ( / ) Stata User Group Meeting in Kyoto / 21

Input image Initialize variables Loop for period of oscillation Update height map Make shade image Change property of image Output image Change time L

,, Poisson 3 3. t t y,, y n Nµ, σ 2 y i µ + ɛ i ɛ i N0, σ 2 E[y i ] µ * i y i x i y i α + βx i + ɛ i ɛ i N0, σ 2, α, β *3 y i E[y i ] α + βx i

日本内科学会雑誌第98巻第4号

Transcription:

TS002

Stata 12 Stata VAR VEC whitepaper mwp 4 mwp-084 var VAR 14 mwp-004 varbasic VAR 26 mwp-005 svar VAR 33 mwp-007 vec intro VEC 51 mwp-008 vec VEC 80 mwp-063 VAR vargranger Granger 93 mwp-062 varlmar 101 mwp-059 varnorm 107 mwp-060 varsoc 113 mwp-057 varstable 118 mwp-058 varwle 124 mwp-061 VEC veclmar 131 mwp-066 vecnorm 135 mwp-067 vecrank 139 mwp-064 vecstable 144 mwp-065

whitepaper mwp irf IRF 149 mwp-006 fcast compute 160 mwp-068 fcast graph 166 mwp-069 StataCorp c 2011 Math c 2011 StataCorp LP Math web: www.math-koubou.jp email: master@math-koubou.jp

mwp-084 Stata var, vec / whitepaper mwp-004, mwp-063, whitepaper arima, arch mwp-083 1. VAR 2. 3. VAR 4. VEC 1. VAR (1) {y t } 1 y t = (y 1t, y 2t,..., y nt ) {y t } = {..., y 1, y 0, y 1,...} (1) {y t } (i) E(y t ) µ µ t (ii) V (y t ) = E[(y t µ)(y t µ) ] t (iii) Cov(y t, y t s ) = E[(y t µ)(y t s µ) ] t s(s > 0) c Copyright Math c Copyright StataCorp LP (used with permission) 4

(2) VAR (VAR: vector autoregression model) AR(p) p y t = A 0 + A i y t i + u t (2) i=1 A 0 n 1 A i (i = 1, 2,..., p) n n u t n 1 u t E(u t ) = 0 (3a) V (u t ) = E(u t u t) = Σ (3b) E(u t u t s ) = 0, for s > 0 (3c) Σ (2) p VAR(p) VAR(p) (2) ( p ) I n A i z i = 0 (4) i=1 1 (3) VAR (2) VAR (SUR: seemingly unrelated regression) SUR VAR OLS (BLUE: best linear unbiased estimator) VAR var *1 [TS] var (mwp- 004 ) var p Stata preestimation varsoc [TS] varsoc (mwp-057 ) *1 VAR varbasic [TS] varbasic (mwp-005 ) 5

2. VAR VEC (innovation accounting) (IRF: impulse response function) (FEVD: forecast-error variance decomposition) 3. VAR 4. VEC (1) x t y t 1 I(1) β 1 x t + β 2 y t I(0) x t y t (cointegrated) β = (β 1, β 2 ) (cointegrating vector) (VECM: vector error correction model) (2) n VAR(p) y t = A 0 + p A i y t i + u t (22) i=1 {y t } y 1t, y 2t,..., y nt I(1) 1 (22) p 1 y t = A 0 + Πy t 1 + Γ i y t i + u t (23) Π = p i=1 A i I n, Γ i = p j=i+1 A j (23) Πy t 1 Πy t 1 i=1 Case 1: Π = 0 p i=1 A i = I n (23) VAR { y t } VAR {y t } 6

Case 2: Πy t 1 y 1t, y 2t,..., y nt 1 Π αβ (23) p 1 y t = A 0 + αβ y t 1 + Γ i y t i + u t (24) α, β n r r Π β r β y t 1 r (error correction term) α (adjustment coefficient vector) (24) VECM (24) (Granger s representation theorem) i=1 (3) (4) VEC VEC 7

mwp-004 var - Stata (VAR: vector autoregressive) whitepaper var VAR IRF FEVD varbasic mwp-005 1. VAR 2. var 2.1 VAR 2.2 2.3 3. var 1. VAR VAR [TS] var intro p543 3 VAR(2) x t y 1t y 2t = v a (1) 1 11 a (1) 12 a (1) 13 v 2 + a (1) 21 a (1) 22 a (1) y a (2) 1,t 1 23 + a (2) y 3t v 3 a (1) 31 a (1) 32 a (1) 33 u 1t u 2t W.N.(Σ) u 3t [TS] var intro y 2,t 1 y 3,t 1 a (1) 11 a (1) 12 a (1) 13 11 a (2) 12 a (2) 13 21 a (2) 22 a (2) 23 a (2) 31 a (2) 32 a (2) 33 A 1 = a (1) 21 a (1) 22 a (1) 23 A 2 = a (2) 21 a (2) 22 a (2) 23 a (1) 31 a (1) 32 a (1) 33 a (2) 31 a (2) 32 a (2) 33 a (2) 11 a (2) 12 a (2) 13 y 1,t 2 y 2,t 2 + u 1t u 2t y 3,t 2 u 3t (M1) c Copyright Math c Copyright StataCorp LP (used with permission) 8

u t (W.N.) Σ (M1) σ 11 σ 12 σ 13 Σ = σ 21 σ 22 σ 23 σ 12 = σ 21, σ 13 = σ 31, σ 23 = σ 32 σ 31 σ 32 σ 33 3 VAR(2) a (1) ij 9 a (2) ij 9 σ ij 6 24 (M1) VAR (SUR: seemingly unrelated regression) SUR VAR OLS (BLUE: best linear unbiased estimator) u t OLS 2. var 2.1 VAR VAR Example lutkepohl2.dta 3 VAR. use http://www.stata-press.com/data/r12/lutkepohl2 * 1 (Quarterly SA West German macro data, Bil DM, from Lutkepohl 1993 Table E.1) (M1) y 1, y 2, y 3 3 dln inv ln(inv) inv dln inc ln(inc) inc dln consump ln(consump) consump inv *1 File Example Datasets Stata 12 manual datasets Time-Series Reference Manual [TS] var 9

. list qtr inv ln inv dln inv in 1/8, separator(4) * 2 qtr inv ln_inv dln_inv 1. 1960q1 180 5.192957. 2. 1960q2 179 5.187386.0055709 3. 1960q3 185 5.220356.03297 4. 1960q4 192 5.257495.0371394 5. 1961q1 211 5.351858.0943627 6. 1961q2 202 5.308268.0435905 7. 1961q3 207 5.332719.0244513 8. 1961q4 214 5.365976.033257 1960q1 1982q4 1978q4 var VAR(2) varsoc [TS] varsoc (mwp-057 ) Statistics Multivariate time series Vector autoregression (VAR) Model : Dependent variables: dln inv dln inc dln consump Lags: Include lags 1 to: 2 1 var Model *2 Data Describe data List data 10

by/if/in : If: qtr <= tq(1978q4) 2 var by/if/in. var dln_inv dln_inc dln_consump if qtr <= tq(1978q4), lags(1/2) Vector autoregression Sample: 1960q4 1978q4 No. of obs = 73 Log likelihood = 606.307 AIC = 16.03581 FPE = 2.18e 11 HQIC = 15.77323 Det(Sigma_ml) = 1.23e 11 SBIC = 15.37691 Equation Parms RMSE R sq chi2 P>chi2 dln_inv 7.046148 0.1286 10.76961 0.0958 dln_inc 7.011719 0.1142 9.410683 0.1518 dln_consump 7.009445 0.2513 24.50031 0.0004 11

Coef. Std. Err. z P> z [95% Conf. Interval] dln_inv dln_inv L1..3196318.1192898 2.68 0.007.5534355.0858282 L2..1605508.118767 1.35 0.176.39333.0722283 dln_inc L1..1459851.5188451 0.28 0.778.8709326 1.162903 L2..1146009.508295 0.23 0.822.881639 1.110841 dln_consump L1..9612288.6316557 1.52 0.128.2767936 2.199251 L2..9344001.6324034 1.48 0.140.3050877 2.173888 _cons.0167221.0163796 1.02 0.307.0488257.0153814 dln_inc dln_inv L1..0439309.0302933 1.45 0.147.0154427.1033046 L2..0500302.0301605 1.66 0.097.0090833.1091437 dln_inc L1..1527311.131759 1.16 0.246.4109741.1055118 L2..0191634.1290799 0.15 0.882.2338285.2721552 dln_consump L1..2884992.1604069 1.80 0.072.0258926.6028909 L2..0102.1605968 0.06 0.949.3249639.3045639 _cons.0157672.0041596 3.79 0.000.0076146.0239198 dln_consump dln_inv L1..002423.0244142 0.10 0.921.050274.045428 L2..0338806.0243072 1.39 0.163.0137607.0815219 dln_inc L1..2248134.1061884 2.12 0.034.0166879.4329389 L2..3549135.1040292 3.41 0.001.1510199.558807 dln_consump L1..2639695.1292766 2.04 0.041.517347.010592 L2..0222264.1294296 0.17 0.864.2759039.231451 _cons.0129258.0033523 3.86 0.000.0063554.0194962 12

(M1) a (1) 11 a (1) 12 a (1) 13 0.320 0.146 0.961 a (1) 21 a (1) 22 a (1) 23 = 0.044 0.153 0.288 a (1) 31 a (1) 32 a (1) 0.002 0.225 0.264 33 a (2) 11 a (2) 12 a (2) 13 a (2) 21 a (2) 22 a (2) 23 a (2) 31 a (2) 32 a (2) 33 v 1 v 2 v 3 0.161 0.115 0.934 = 0.050 0.019 0.010 0.034 0.355 0.022 0.017 = 0.016 0.013 p dln inv a (1) 11 a(2) 11, a(1) 12, a(2) 12, a(1) 13, a(2) 13, v 1 0 VAR 2.3 Σ e(sigma). matrix list e(sigma) * 3. matrix list e(sigma) symmetric e(sigma)[3,3] dln_inv dln_inc dln_consump dln_inv.00192542 dln_inc.00006475.00012417 dln_consump.00011142.00005557.00008065 2.2 2.3 *3 ereturn list 13

3. var var postestimation # 1 varsoc varlmar varstable varnorm Granger vargranger lag-exclusion varwle 2 predict fcast compute/graph 3 IRF IRF/DM/FEVD irf 14

mwp-008 vec intro - Stata (VECM: vector error-correction models) whitepaper VECM whitepaper 1. Granger 2. 3. VECM 3.1 3.2 3.3 VECM 3.4 Johansen 3.5 3.6 3.7 VECM 1. Granger VECM E(y t ) = µ y t t k Cov(y t, y t k ) = E[(y t µ)(y t k µ)] = γ k (weak stationary) (covariance stationary) y t y t = y t y t 1 (unit root process) y t I(1) d 1 d d (integrated process) I(d) I(0) c Copyright Math c Copyright StataCorp LP (used with permission) 15

y t I(1) c y t I(0) c y t (cointegration) y t (cointegrated) c (cointegrating vector) Granger (Granger representation theorem) Granger [TS] vec intro p626 (7) K VAR(p) I(1) y t [TS] vec intro p626 (8) VECM y t r Π K K αβ K r β β y t I(0) r α (adjustment parameters) 2. vec vec Model 5 1 vec - Model 16

[TS] vec intro p626 (8) p627 (9) (11) µ, ρ, γ, τ 5 [TS] vec intro Trends in the Johansen VECM framework p627 3. VECM Example txhprice.dta VEC. use http://www.stata-press.com/data/r12/txhprice * 1 4 Austin, Dallas, Houston, San Antonio t austin dallas houston sa 1. 1990m1 11.40422605 11.6324847 11.38849539 11.19134184 2. 1990m2 11.39639165 11.62803827 11.41861479 11.22257316 3. 1990m3 11.36442546 11.60550465 11.39188714 11.29849385 4. 1990m4 11.11393932 11.62625415 11.442503 11.39863632 165. 2003m9 12.14579171 12.16837078 12.04590389 11.80931948 166. 2003m10 12.19955143 12.14046689 12.05117168 11.78524006 167. 2003m11 12.19551713 12.15898104 12.06968002 11.84438516 168. 2003m12 12.25200158 12.17303279 12.10625231 11.85296277 *1 File Example Datasets Stata 12 manual datasets Time-Series Reference Manual [TS] vec intro 17

2 4 Dallas Houston 3 2 18

3.1 var vec varsoc [TS] vec intro p626 (7) (8) VECM VAR p 1 vec VAR p dallas, houston varsoc Statistics Multivariate time series VEC diagnostics and tests Lag-order selection statistics (preestimation) Main : Dependent variables: dallas houston Options: Maximum lag order: 4 4 varsoc - Main 19

. varsoc dallas houston Selection order criteria Sample: 1990m5 2003m12 Number of obs = 164 lag LL LR df p FPE AIC HQIC SBIC 0 299.525.000091 3.62835 3.61301 3.59055 1 577.483 555.92 4 0.000 3.2e 06 6.9693 6.92326 6.85589 2 590.978 26.991* 4 0.000 2.9e 06* 7.0851* 7.00837* 6.89608* 3 593.437 4.918 4 0.296 2.9e 06 7.06631 6.95888 6.80168 4 596.364 5.8532 4 0.210 3.0e 06 7.05322 6.9151 6.71299 Endogenous: dallas houston Exogenous: _cons (LR: likelihood ratio) LR FPE * 2 2 4 4 3. varsoc dallas houston austin sa. varsoc dallas houston austin sa Selection order criteria Sample: 1990m5 2003m12 Number of obs = 164 lag LL LR df p FPE AIC HQIC SBIC 0 736.851 1.5e 09 8.93721 8.90651 8.8616 1 1129.33 784.96 16 0.000 1.6e 11 13.5284 13.3749 13.1504* 2 1155.49 52.314 16 0.000 1.4e 11 13.6523 13.376* 12.9718 3 1175.68 40.378* 16 0.001 1.3e 11* 13.7034* 13.3043 12.7205 4 1185.84 20.339 16 0.205 1.4e 11 13.6322 13.1105 12.3469 Endogenous: dallas houston austin sa Exogenous: _cons 20

3.2 VECM vec 1 vecrank Statistics Multivariate time series Cointegrating rank of a VECM Model : Dependent variables: dallas houston 5 vecrank - Model. vecrank dallas houston, trend(constant) Johansen tests for cointegration Trend: constant Number of obs = 166 Sample: 1990m3 2003m12 Lags = 2 5% maximum trace critical rank parms LL eigenvalue statistic value 0 6 576.26444. 46.8252 15.41 1 9 599.58781 0.24498 0.1785* 3.76 2 10 599.67706 0.00107 Johansen * 2 1 1 4 vecrank 2 21

. vecrank austin dallas houston sa, lag(3). vecrank austin dallas houston sa, lag(3) Johansen tests for cointegration Trend: constant Number of obs = 165 Sample: 1990m4 2003m12 Lags = 3 5% maximum trace critical rank parms LL eigenvalue statistic value 0 36 1107.7833. 101.6070 47.21 1 43 1137.7484 0.30456 41.6768 29.68 2 48 1153.6435 0.17524 9.8865* 15.41 3 51 1158.4191 0.05624 0.3354 3.76 4 52 1158.5868 0.00203 3.3 VECM 3.1 3.2 1 1/2 VEC y t = (dallas, houston) ( ) ( ) y1t v1 = + y 2t v 2 ( α1 α 2 ) (β1 β 2 ) ( ) ( ) ( ) ( ) y1,t 1 γ11 γ + 12 y1,t 1 ε1t + y 2,t 1 γ 21 γ 22 y 2,t 1 ε 2t (M1) Statistics Multivariate time series Vector error-correction model (VECM) Model : Dependent variables: dallas houston Number of cointegrating equations (rank): 1 Maximum lag to be included in underlying VAR model: 2 Trend specification: constant * 2 *2 22

6 vec - Model. vec dallas houston, trend(constant) Vector error correction model Sample: 1990m3 2003m12 No. of obs = 166 AIC = 7.115516 Log likelihood = 599.5878 HQIC = 7.04703 Det(Sigma_ml) = 2.50e 06 SBIC = 6.946794 Equation Parms RMSE R sq chi2 P>chi2 D_dallas 4.038546 0.1692 32.98959 0.0000 D_houston 4.045348 0.3737 96.66399 0.0000 23

Coef. Std. Err. z P> z [95% Conf. Interval] D_dallas _ce1 L1..3038799.0908504 3.34 0.001.4819434.1258165 dallas LD..1647304.0879356 1.87 0.061.337081.0076202 houston LD..0998368.0650838 1.53 0.125.2273988.0277251 _cons.0056128.0030341 1.85 0.064.0003339.0115595 D_houston _ce1 L1..5027143.1068838 4.70 0.000.2932258.7122028 dallas LD..0619653.1034547 0.60 0.549.2647327.1408022 houston LD..3328437.07657 4.35 0.000.4829181.1827693 _cons.0033928.0035695 0.95 0.342.0036034.010389 Cointegrating equations Equation Parms chi2 P>chi2 _ce1 1 1640.088 0.0000 Identification: beta is exactly identified Johansen normalization restriction imposed beta Coef. Std. Err. z P> z [95% Conf. Interval] _ce1 dallas 1..... houston.8675936.0214231 40.50 0.000.9095821.825605 _cons 1.688897..... 24

vec ce cointegrating equations β 2 VECM(1) ( ) ˆβ1 = ˆβ 2 ( ) 1 0.868 y 1t 0.868 y 2t 1.689 (M2) I(0) (adjustment coefficients) α ) ( ) ) ( ) ) (ˆα1 0.304 (ˆv1 0.0056 (ˆγ11 ˆγ = = 12 = ˆα 2 0.503 ˆv 2 0.0034 ˆγ 21 ˆγ 22 ( 0.165 ) 0.0998 0.062 0.333 (M2) VECM 1 3.5 y 3. predict ce, ce equation( ce1). twoway (line ce t), yscale(range(-0.5 0.5)) yline(0) ylabel(-0.4(0.2)0.4) 25

3.4 Johansen 3.5 (1) predict VECM predict Statistics Postestimation Predictions, residuals, etc. Main : New variable name: ce1 Produce: Prediction of cointegrating equation: Equation to predict: ce1 8 predict - Main. predict ce1, ce equation(_ce1) ce2. predict ce2, ce equation( ce2). predict ce2, ce equation(_ce2) 26

ce1, ce2. twoway (line ce1 t), yscale(range(-0.5 0.5)) yline(0) ylabel(-0.4(0.2)0.4) > title(" ce1") * 3. twoway (line ce2 t), yscale(range(-0.5 0.5)) yline(0) ylabel(-0.4(0.2)0.4) > title(" ce2") ce1 2000 *3 Graphics Twoway graph (scatter, line, etc.) 27

(2) vecstable (3) veclmar (4) vecnorm 3.6 3.7 VECM 28

mwp-006 irf - IRF irf var, svar, vec irf 10 3 irf set IRF irf create IRF irf graph whitepaper VAR VEC [TS] vecintro (mwp-008 ) 1. IRF 2. Cholesky ordering 3. DM 4. FEVD 1. IRF (IRF: impulse response function) 1 VAR(p) [TS] irf create p180 (1) Σ IRF IRF (orthogonalized IRF) (Cholesky decomposition) Σ [TS] irf create p180-181 c Copyright Math c Copyright StataCorp LP (used with permission) 29

(1) VAR IRF VAR Example lutkepohl2.dta. use http://www.stata-press.com/data/r12/lutkepohl2 * 1 (Quarterly SA West German macro data, Bil DM, from Lutkepohl 1993 Table E.1) dln inv, dln inc, dln consump 3 VAR(2) mwp-004. var dln inv dln inc dln consump if qtr<=tq(1978q4), lags(1/2) dfk * 2. var dln_inv dln_inc dln_consump if qtr<=tq(1978q4), lags(1/2) dfk Vector autoregression Sample: 1960q4 1978q4 No. of obs = 73 Log likelihood = 606.307 AIC = 16.03581 FPE = 2.18e 11 HQIC = 15.77323 Det(Sigma_ml) = 1.23e 11 SBIC = 15.37691 Equation Parms RMSE R sq chi2 P>chi2 dln_inv 7.046148 0.1286 9.736909 0.1362 dln_inc 7.011719 0.1142 8.508289 0.2032 dln_consump 7.009445 0.2513 22.15096 0.0011 Coef. Std. Err. z P> z [95% Conf. Interval] dln_inv dln_inv L1..3196318.1254564 2.55 0.011.5655218.0737419 L2..1605508.1249066 1.29 0.199.4053633.0842616 dln_inc L1..1459851.5456664 0.27 0.789.9235013 1.215472 L2..1146009.5345709 0.21 0.830.9331388 1.162341 dln_consump L1..9612288.6643086 1.45 0.148.3407922 2.26325 L2..9344001.6650949 1.40 0.160.369162 2.237962 _cons.0167221.0172264 0.97 0.332.0504852.0170409 *1 File Example Datasets Stata 12 manual datasets Time-Series Reference Manual [TS] irf *2 Statistics Multivariate time series Vector autoregression (VAR) 30

dln_inc dln_inv L1..0439309.0318592 1.38 0.168.018512.1063739 L2..0500302.0317196 1.58 0.115.0121391.1121995 dln_inc L1..1527311.1385702 1.10 0.270.4243237.1188615 L2..0191634.1357525 0.14 0.888.2469067.2852334 dln_consump L1..2884992.168699 1.71 0.087.0421448.6191431 L2..0102.1688987 0.06 0.952.3412354.3208353 _cons.0157672.0043746 3.60 0.000.0071932.0243412 dln_consump dln_inv L1..002423.0256763 0.09 0.925.0527476.0479016 L2..0338806.0255638 1.33 0.185.0162235.0839847 dln_inc L1..2248134.1116778 2.01 0.044.005929.4436978 L2..3549135.1094069 3.24 0.001.1404798.5693471 dln_consump L1..2639695.1359595 1.94 0.052.5304451.0025062 L2..0222264.1361204 0.16 0.870.2890175.2445646 _cons.0129258.0035256 3.67 0.000.0060157.0198358 (2) IRF IRF FEVD.irf / irf001.irf irf set 31

Statistics Multivariate time series Manage IRF results and files Set active IRF file irf set : Set active IRF file: irf001 Replace any existing file with an empty file: 1 irf set. irf set "irf001", replace (file irf001.irf created) (file irf001.irf now active) irf001.irf Stata (3) IRF IRF FEVD irf create order1 order1 2 Statistics Multivariate time series IRF and FEVD analysis Obtain IRFs, dynamic-multiplier functions, and FEVDs Main : Create IRF and store as name: order1 Forecast horizon: 8 32

2 irf create - Main. irf create order1 (file irf001.irf updated) irf001.irf order1 (4) IRF order1 OIRF 3 VAR 3 3 = 9 9 dln inc dln consump Statistics Multivariate time series IRF and FEVD analysis Graphs by impulse or response Main : Statistics to graph: Orthogonalized impulse-response functions (oirf) IRF result sets: order1 Impulse variables: dln inc Response variables: dln consump 33

3 irf graph - Main. irf graph oirf, irf(order1) impulse(dln_inc) response(dln_consump) 34

2. Cholesky ordering 3. DM 4. FEVD 35