*==============================================================================* * Advanced Applied Econometrics * Jakub Muck * Example of VAR models * importing data clear all use "http://web.sgh.waw.pl/~jmuck/AAE/Datasets/VAR1.dta" * 0. data preparation sort date gen t=_n tsset t * 1. baseline var model var FFR UNRATE infl * var model with 12 lags var FFR UNRATE infl, lags(1/12) * normality of the error term varnorm * serial correlation varlmar, mlag(12) * stability varstable * 2. Cholesky decomposition/ orthogonalized IRFs irf create myirf, step(60) set(myirf,replace) irf graph oirf irf graph fevd * 3. The AB SVAR model matrix A=(.,0,0\.,.,0\.,.,.) matrix B=(1,0,0\0,1,0\0,0,1) svar FFR UNRATE infl, aeq(A) beq(B) irf create myirf, step(60) set(myirf,replace) irf graph sirf irf graph sfevd * 4. Long-run restrictions clear all use "http://web.sgh.waw.pl/~jmuck/AAE/Datasets/VAR2.dta" sort date gen t=_n tsset t matrix LR=(.,0\.,.) svar dY UNRATE, lags(1/8) lreq(LR) irf create myirf, step(60) set(myirf,replace) irf graph sirf irf graph sfevd