






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Material Type: Exam; Class: APPLIED ECONOMETRICS; Subject: Economics; University: Clark University; Term: Unknown 1995;
Typology: Exams
1 / 10
This page cannot be seen from the preview
Don't miss anything!
Econ 366 Introduction to Time Series Analysis - Empirical Methods using Eviews
This guide shows you how to recreate the results for the time series analysis used as an example in class. For the corresponding graphs and tables see the sheets/handouts on this topic.
Start EViews
1. Open the work file. Select Menu options File/Open/Workfile
Select the existing workfile FinTimesSP.wf1 from the directory where you saved it.
The workfile contains the time series data for the Financial Times All Share Price index, monthly observations, January 1965 (1965:01) to December 1995 (1995:12)
Note: if you want to start from scratch, with a new dataset, follow these steps: Select Menu options File/New/Workfile
Set the frequency of the data (in this example, Monthly), and enter the data range (in this example, 1965:01 and 1995:12.
An untitled workfile opens with the variables: c and resid (constant and residual). Save the workfile.
You import data, from a database, excel, text, etc., by selecting Proc /Import and then selecting the relevant option.
2. Create New Variables
There are two ways to create new variables. One is to use the programming component of eviews (this method is quicker). Select Menu options File/New/Program.
In the window that appears, type in the commands that create the new variables, then select Run. You can save the program for future use by selecting Save.
The alternative way to create additional series is to use the command window at the top and type the same commands (when you hit return after typing each line the command is completed):
Smpl @all Series lnftpr = log(ftpr) Series mreturn = 100(ftpr/ftpr(-1)-1) Series mlogreturn = 100log(ftpr/ftpr(-1))**
For both methods, see picture above.
3. Descriptive Statistics Select series ftpr. Select View/Graph/Line Observe that ftpr is a gradually upward moving time series.
Select series lnftpr. Select View/Graph/Line Observe that lnftpr is also a gradually upward moving time series, but the log values appears to move along a straight line and not explode as did the series ftpr.
Select series mreturn. Select View/Graph/Line Observe that changes (%pm) in ftpr appear to fluctuate around a constant mean. Frequently one will observe that the volatility of financial time series tends to change over time (heteroscedasticity) and is clustered in periods of higher and lower volatility. (You can test for this using ARCH/Garch)
Select View/Descriptive Statistics/Histogram and Stats Review the statistics on the distribution properties of the series. Skewness, kurtosis, Jarque-Bera test statistics provide evidence on normality.
4. HP Filter
We can decompose the data into approximate permenant and transitory components using the Hodrick Prescott Filter. In the example below we can apply this technique to the variable lnftpr, and use different smoothing pararmeters (for monthly data, the suggested value is 14400).
Select the options on lag length determination
iii. Cointegration Select Menu options File/Open/Workfile Select the existing workfile FinTimesVAR.wf. The workfile contains the time series data for the Financial Times-All Share Price Index, Financial Times-All Share Dividend Index, yield on 20 year Gilts (government bonds), rate on 91 day Treasury bills. Monthly observations, January 1965 to December
a. Estimate long-run cointegration equation Estimate using OLS the cointegration equation. Again, use the Command window or write a short program:
Smpl 1965:1 1995: LS lprice c ldiv r20 rs
Select Equation window Procs/Make Residual Series , select ordinary and provide the series name ECM.
b. Cointegration test using ADF Select Workfile window series ECM. Select Series Window View/Unit Root Test. Select ADF, levels, no trend or constant term (we do not expect a regression residual to have a trend or nonzero mean). Selection of lags in this case using SIC max. 16, but you may use one of the other criteria if you want. Note that the critical values of the ADF test supplied by EViews are not correct for the ADF-cointegration test. McKinnon (1991, Table 1) ‘Critical values for cointegration tests’ in Engle and Granger (eds) Long-Run Economic Relationships provides a formula to obtain the correct critical values.
c. Cointegration test using Kremers et al. (1992), i.e. ECM Estimate using OLS the general short-run dynamic equation. Command window Smpl 1965:1 1995: LS dlprice c dlprice(–1 to –4) dldiv(–1 to –4) dr20(–1 to –4) drs(–1 to –4) ecm(-1) Eliminate insignificant variables and lags taking (using Hendry’s general-to-specific-modeling approach): LS dlprice c dlprice(–1 to –3) dldiv(–3) dr20(–1) drs(–1) ecm(-1) Observe that coefficients of dlprice(-1) and dlprice(-2) are very close but opposite in sign. Impose restriction. LS dlprice c d(dlprice(–1)) dlprice(–3) dldiv(–3) dr20(–1) drs(–1) ecm(-1)
Having selected a preferred short-run error correction model, we now determine whether the error correction variable ecm(-1) is statistically significant (using normal t-test following Banerjee et al., 1993) and has a negative sign.
5. Vector AutoRegression (VAR) analysis
Select Menu options File/Open/Workfile Again, select the existing workfile FinTimesVAR.wf1 from the directory where you saved it. See the cointegration section above for the contents of this workfile.
Additional series are created in the command window at the top or in a program as
Smpl @all Series lprice = log(ftaprice) Series ldiv = log(ftadiv) Series dlprice = lprice – lprice(-1) or d(lprice) or dlog(ftaprice) Series dldiv = ldiv – ldiv(-1) or d(ldiv) or dlog(ftadiv) Series dr20 = r20 – r20(-1) or d(r20) Series drs = rs – rs(-1) or d(rs)
i. Stationarity. We have already discussed how to perform unit root tests in the time series example. You normally do these tests to decide on a VAR model in levels or first-differences of the variables. As we have discussed, some econometricians have argued that the debate on stationary, nonstationary variables is mostly irrelevant for VAR modelling and that one is allowed to use a levels VAR in any case.
ii. VAR Estimation Method One: The long way to create and estimate a VAR model is as follows: First select the series you wish to analyze: dldiv, dlprice, dr20, drs
Press CTRL and left-click the variables with your mouse.
Select Workfile window Objects/New Object/Group Select Group window Procs/Make Vector Autoregression Select Unrestricted VAR, sample 1965:01 1995:12 (This is the full data period. However, the estimations will automatically adjust the sample period for missing observations!) Cointegration and VECM models will be discussed later.
Lag length selection criteria Select VAR window View/Lag Structure/Lag length criteria, max lags 12 You will find the model selection criteria log-likelihood, LR, FPE, AIC, SIC, HQ. Note that the estimation period of the VARs in this option is the same for all the models considered and therefore depends on the max. number of lags you want to consider. Once you have decided the optimal number of lags, the estimation period changes according to the selected lag number.
Check for residual correlation. The traditional approach, using stationary variables in the VAR model, also recommends that residuals of the VAR equations do not exhibit residual correlation. (If you use the VAR in its long run, levels form as suggested by Sims and others, and do not worry about I(1) variables, the test on residual correlation is considered less important.) The lag length criteria suggest a model with either 1 or 2 lags. Select VAR window Estimate. Select Lag intervals 1 1 Select VAR window View/Residual Tests/Portmanteau Autocorrelation Test/ Lags 12 Repeat for VAR model with lag intervals 1 2 Applying the no-residual-correlation criterion, a VAR model is selected with 2 lags. View the final VAR estimation results by selecting VAR window Stats (note that the VAR model is already in its 2 lag form).
Method Two: The quick way to create a program, that (in the first line) estimates a VAR (var1 is the name I chose, and .ls implies it is a VAR (it uses least squares) – the other option is .ec (an error correction model)), the lag length is 12 (1 12) and it has 4 endogenous variables. The second line saves a variable, which I chose to be v1 , that saves the information on the optimal lag length selected by the criterion listed above.
var var1.ls 1 12 dldiv dlprice dr20 drs show var1.laglen(12,vname=v1)
Select Cointegration Test Specification. We have to decide on including intercepts and trends in the model. For this we have to look carefully at the data and apply some economic logic. (Note: If you wish to change the sample period for the cointegration tests, you have to go to the Estimate/Basics window.)
If we chose option 2 (intercept in the CE, no intercept in the VAR/VEC) as our preferred model. The results suggest (rank) r ≤0 is rejected, but r ≤1 is not rejected. Therefore we conclude that there is 1 cointegration equation.
Select Var Window Estimate/Cointegration Select Rank, number of cointegration equations is 1 (corresponding to the earlier VAR cointegration test). Select Option 2 on constants and trends (intercept in CE, no intercept in VAR/VEC). You now see the estimated cointegration equation.
b. VEC Restrictions The estimated standard errors for the coefficients give you suggestions for imposing restrictions. For example, the coefficients on r20 and rs appear to be not significantly different from 0. To impose these restrictions:
Select Var Window Estimate/VEC Restrictions Select Impose Restrictions. Note: EViews keeps the coefficients of the long-run cointegration model in a matrix called B: The number of rows of matrix B correspond to the number of selected cointegration equations (in this case 1). The columns of matrix B correspond to the variables ordered according to their listing in Estimate/Basics ). To impose restrictions on coefficients you write B(1,1)=1 (note: coeff of 1 for lprice), B(1,2)=-1 (note: coeff of 1 for ldiv), B(1,3)=0 (coeff of 0 for r20), B(1,4)=0 (coeff of 0 for rs). Also, the coeffiecient of the error correction terms are kept in a matrix called A. In this case, the rows signify the equation number, in the order of the respresentation give. So that A(2,1)=0, A(4,1)=0 imposes zero restrictions on the error correction term in equations 2 and 4. The statistical significance of these restrictions is provided by the Chi-square statistic. You find that these restrictions are rejected (Chi-square statistic is too large, Probability too low).
iv. Forecasts To work with the estimated VAR model in forecasts and simulations, you have to transfer the estimated equations into a model (a set of equations) to be used in EViews model operations. EViews allows you to make this model very easily. Select VAR window Procs/Make Model/Solve. Set solution sample to 1996:01 2000:12 (You may have to extend the workfile range. Go to the workfile window, select Change Workfile Range , and change the date.
The forecasts appear in the Workfile window because there are new variables being generated called <
Produce the graphs Select Model window Procs/Make Graph and select the endogenous variables, series grouping as each series in its own graph, sample period 1995:01 1996:12, for the Baseline scenario (the variables referred to as _0). You can also select the variables _ and make a new EViews Object/Group window.
v. Impulse response functions Select VAR window Impulse (or View/Impulse Response …). The default (Under Impulse Definition is Cholesky – dof adjusted and variables Ordering dldiv dlprice dr20 drs). Under Impulse Display select Multiple Graphs, Response standard errors – Monte Carlo, and periods 10 (you can select more periods). Note that you can modify the order of the variables, which changes the identification scheme of the VAR shocks and affects the IRFs and FEDVs
Note that there are alternative ways of producing standard errors for the IRFs. Of course, you need the st.errors to evaluate whether the estimated impulse response at a given horizon can be considered statistically significant. It is usual to select the Monte Carlo method and request at least a 1000 replications.
(Note: As the VAR is in first differences, you may repeat making by selecting Accumulated Responses under Impulse Display (which accumulated first differences).
ix. Additional Analysis The following tests on VARs are not easily implemented in EViews using its standard options (Although I am not sure if they are included in Eviews 5 which is available in the next week or two). These tests involve estimating the VAR equations individually and calculating some of the needed results using the EViews programming features. The tests are sometimes used in empirical studies (see Sims, 1980).
Tests for dropping a variable from the entire VAR system. As we discussed in class, general tests of restrictions on the VAR model can be carried out by comparing the determinants of the restricted and unrestricted covariance matrices of the equation errors. The restrictions would be that the variable considered for exclusion has coefficients equal to zero in the equations for all the other variables (thus, except its own equation). The test statistic is LR = (T-k) [log(det(ΩRestr^ )) – log(det(ΩUnrestr))] Where T is the number of observations and k is the number of estimated coefficients in each equation of the unrestricted model (in our example, k = 4*2+1= 9). This statistic is distributed as χ^2 with degrees of freedom equal to the number of restrictions; in our example, 2 lags of a variable in (4-1=) 3 equations equal 6 restrictions. EViews presents you the value of the determinant of the residuals covariance matrix as part of the estimation output and also allows you to save the covariance matrix of residuals Ω, and calculate its determinant.
To apply the likelihood ratio test click on View/Residuals/Covariance matrix. Type in command window matrix(n,n) rescov (with n the number of VAR equations) Select workfile window matrix variable rescov. Copy using Copy (Ctrl-C), Edit, Paste (Ctrl-V) the matrix values from the VAR window to the matrix window rescov.
Type command window scalar det_cov1= @det (rescov).
If you select workfile variable det_cov1 you can see its value at the bottom line of the EViews window. (If you do this, compare your result with the value presented with the VAR output.)
In EViews the Unrestricted VAR option does not allow you to impose the equation restrictions necessary for this test. But in principle you would repeat the previous actions for the restricted VAR model, calculate the likelihood ratio statistic, and determine its significance level from the χ^2 distribution. You can in EViews estimate the VAR models following the equation-by- equation approach, store the residuals for each equation, calculate the residuals covariance matrix, calculate the matrix determinant, and calculate the LR test statistic. If you write a small EViews program it is less work than you might think.
Tests for structural change (i.e. comparing 2 subsample periods) Create an unrestricted VAR where in each equation additional variables enter as dummy variables (values 0,1 for the two subperiods) multiplied by the original variables values (including the constant term!). Also create the restricted VAR without the dummyvariable part in the equations. You can test the null hypothesis of no structural change equation-by-equation by testing the significance of all the dummy variables (Wald-test, F-test, log-likelihood-ratio test) in every single equation. You can test the null hypothesis of no structural change for the entire VAR model, by using the LR test based on the determinants of the residual covariance matrixes (see above). The LR statistic is distributed as χ^2 with degrees of freedom equal to the number of restrictions; in this case, dummies for 2 lags of each variable plus the intercept in 4 equations, equaling 4(2*4+1) = 36 restrictions.
Note: All of the steps described above can be programmed into an EViews program. This allows you to repeat your steps as many times as necessary and also provides a log of your steps allowing you to account for your results when you write an empirical thesis or paper. See the Help option Command & Programming Reference (pdf) and read especially Chapter 6 EViews programming.