clear set mem 15m use http://www.pabsta.qc.ca/sites/default/files/tsx.dta cd "/Users/pabsta/documents/2-enseignement/ECON452/tutorial5/" log using "OUTPUT/tutorial5-2.txt", t replace tsset date tsline tsx /* Exponential increase of the process: - This is not stationarty! - This also suggest that logarithms can linearize the sytem */ gen ltsx = ln(tsx) tsline ltsx // Trend or drift? dfuller ltsx dfuller ltsx, trend dfuller ltsx, drift /* There seems to have a unit-root. And this unit-root is gone after differenciating. Note that adding a trend does not remove the unit-root. We first need to get rid of the time trend. */ gen DlogGDP = D.logGDP dfuller DlogGDP dfuller DlogGDP, trend dfuller DlogGDP, drift //This seems to do the trick: no unit-root anymore. //Next move: estimate the AR? and MA(q) components pac DlogGDP //First and fifth lags are important. Looks like an AR(1). ac DlogGDP //High persistence of the series, "almost" no exponential decline. //Some oscillating patterns, which indicate that the AR component dominates the picture. //The first 10 lags are significantly different from zero. //We proceed to a first broad estimation //Programming tip: the command below lets the estimation run by itself //without having to type everytime the screen displays "more". set more off arima DlogGDP, ar(1,2,3,4,5) ma(1,2,3,4,5,6,7,8,9,10) //Note that it takes a while to estimate! //Some unestimated coefficients: common factors. //Lets try with smaller values for the MA(q) arima DlogGDP, ar(1,2,3,4,5) ma(1,2,3,4,5,6,7,8) //Still problems of unestimated coefficients. //Reduce again. //... arima DlogGDP, ar(1,2,3,4,5) ma(1,2,3,4) //Test if the last lags of the MA are insignificant test ([ARMA]L4.ma = 0) ([ARMA]L3.ma = 0) ([ARMA]L2.ma = 0) ([ARMA]L1.ma = 0) //Too much information (reject H0) //The last two. test ([ARMA]L4.ma = 0) ([ARMA]L3.ma = 0) //New estimation arima DlogGDP, ar(1,2,3,4,5) ma(1,2,3) //Negative variance?!? (look at the confidence region! This is clearly wrong) arima DlogGDP, ar(1,2,3,4,5) ma(1, 2) test ([ARMA]L1.ma = 0) ([ARMA]L2.ma = 0) //Reject H0 arima DlogGDP, ar(1,2,3,4,5) ma(1) test ([ARMA]L4.ar = 0) ([ARMA]L5.ar = 0) test ([ARMA]L4.ar = 0) ([ARMA]L5.ar = 0) ([ARMA]L3.ar=0) arima DlogGDP, ar(1,2,3) ma(1) //Further testsÉ test ([ARMA]L3.ar = 0) ([ARMA]L2.ar = 0) ([ARMA]L1.ma=0) test ([ARMA]L3.ar = 0) ([ARMA]L1.ma=0) arima DlogGDP, ar(1,2) ma(1) arima DlogGDP, ar(1,2) arima DlogGDP, ar(1) //One spec to keep in mind. //Now what if we reduce AR firsts? arima DlogGDP, ar(1,2,3,4,5) ma(1,2,3,4) test ([ARMA]L5.ar = 0) ([ARMA]L4.ar = 0) //Not significant at the 95% level but significant at 10%É arima DlogGDP, ar(1,2,3, 4) ma(1,2,3,4) //Common factor arima DlogGDP, ar(1,2,3) ma(1,2,3) test ([ARMA]L3.ar = 0) ([ARMA]L2.ar = 0) //reject hO arima DlogGDP, ar(1,2) ma(1,2,3) //First lag significant at 10%, but nothing elseÉ arima DlogGDP, ar(1) ma(1,2,3) arima DlogGDP, ar(1) ma(1,2) //This is a candidate model. //Which one should we pick? A criterion is the one with the smallest variance, namely the last one. varsoc DlogGDP //This suggest as well that we should have an AR(1) predict DlogGDP_pred, xb //Interpretation for this: last year's growth is a good predictor of this year's growth. //However, the past innovations in growth have persistence (2 years). log close