Presentation is loading. Please wait.

Presentation is loading. Please wait.

LINREG linreg(options) depvar start end residuals # list where: depvar The dependent variable. start endThe range to use in the regression. The default.

Similar presentations


Presentation on theme: "LINREG linreg(options) depvar start end residuals # list where: depvar The dependent variable. start endThe range to use in the regression. The default."— Presentation transcript:

1 LINREG linreg(options) depvar start end residuals # list where: depvar The dependent variable. start endThe range to use in the regression. The default is the largest common range of all variables in the regression. residualsSeries name for the residuals. Omit if you do not want to save the regression residuals. listThe list of explanatory variables.

2 Examples of LIN lin y # constant x lin y 1991:12 2001:8 # constant x lin y 1991:12 2001:8 resids # constant y{1 2 5} lin y / resids # constant y{1 to 4}

3 Internal Variables LINREG creates a number of variables that you can use in subsequent computations. A partial list of these variables is: %BETA The coefficient vector. The first coefficient estimated is %BETA(1), the second %BETA(2), and so on. For example, in the output for dlja above, the constant is %BETA(1), the coefficient for dlja{1} is %BETA(2), and so forth. %tstats The vector of t-stats %NDF Degrees of freedom. %NOBS Number of observations. %NREG Number of regressors. %RSS Residual sum of squares. %RSQUARED Centered R 2 (i.e, the usual measure of R 2 ) %SEESQ Standard error of estimate squared

4 Correlate Correlate(options) series start end (saveseries) where: series The series used to compute the correlations. Results= series used to save the correlations NUMBER= The number of autocorrelations to compute. The default is the integer value of one-fourth the total number of observations. PARTIAL=Series for the partial autocorrelations. If you omit this option, the PACF will not be calculated. QSTATSUse this option if you want the Ljung-Box Q- statistics. SPAN=Use with qstats to set the width of the intervals tested. For example, with quarterly data, you can set span = 4, to obtain Q(4), Q(8), Q(12), and so forth.

5 The AIC and the SBC com sbc = nobs*log(%rss) + %nreg*log(%nobs) compute aic = %nobs*log(%rss) + 2*%nreg display 'AIC' aic 'SBC' sbc

6 BOXJENK BOXJENK depvar start end residuals Options AR=number of autoregressive parameters [0] MA=number of moving average parameters [0] iters= number of iterations SAR=number of seasonal autoregressive parameters [0] SMA=number of seasonal moving average parameters [0] DIFFS=number of regular differencings [0] SDIFFS=number of seasonal differencings [0] CONSTANT/[NOCONSTANT]

7 Technical Issues Constant in the equation box(constant, ar=||1,4||, ma = 2) y Negative values of the aic and bic aic = T ln(%rss) + 2*%nobs To use the aic and bic, the models must be estimated over the same sample period. box(constant, ar=||1,4||, ma = 2) dly 90:1 * box(constant, ar=1, ma = 2) dly 90:1 *

8 Technical Issues 2 Did not converge error message The program cannot find the solution for the coefficients that minimizes the residual sum of squares. increase iters iters=50 The model is too complex (too unnecessary many parameters)

9 Transforming the series When to difference? When to use the log? Graph the transformed series Check ACF of the transformed series

10 The ACF Label the graph of the autocorrelations Alter bjident.src Write in the essential details plot the correlations yourself ACF of the residuals

11 Bjident @BJIDENT series start end Options DIFF=maximum regular differencings[0] SDIFFS=maximum seasonal differencings[0] TRANS=[NONE]/LOG/ROOT Transformation to apply to data [GRAPH]/NOGRAPH SPAN=seasonal span

12 Forecast forecast(print) number steps start # equation forecasts number The number of equations in the system. In univariate forecasting, number is necessarily equal to 1. stepsThe number of forecasts to create. startThe starting period of the forecasts. equationThe name of the previously defined equation. forecastsThe name of the series in which you want to save the forecasts. This field is optional. Example boxjenk(define=eq1,ar=1,ma=1) y / resids forecast(print) 1 5 101 # eq1

13 Forecast -- New FORECAST equations # equation forecasts FROM =starting period of the forecast interval TO =ending period of the forecast interval STEPS =number of forecast steps to compute FROM and TO set the starting and ending periods for the forecasts, or FROM and STEPS to set the starting date and number of steps (periods) PRINT/[NOPRINT]

14 Seasonality in the Box-Jenkins framework Seasonal AR coefficients y t = a 1 y t-1 +a 12 y t-12 + a 13 y t-13 y t = a 1 y t-1 +a 12 y t-12 + a 1 a 12 y t-13 (1 - a 1 L)(1 – a 12 L 12 )y t Seasonal MA Coefficients Seasonal differencing: = y t – y t-12

15 Seasonality in the Box-Jenkins framework Seasonal AR coefficients y t = a 1 y t-1 +a 12 y t-12 + a 13 y t-13 y t = a 1 y t-1 +a 12 y t-12 + a 1 a 12 y t-13 (1 - a 1 L)(1 – a 12 L 12 )y t Seasonal MA Coefficients Seasonal differencing:  y t = y t – y t-1 versus   y t = y t – y t-12 NOTE: You do not difference 12 times dif(sdiffs=1) y / sdy


Download ppt "LINREG linreg(options) depvar start end residuals # list where: depvar The dependent variable. start endThe range to use in the regression. The default."

Similar presentations


Ads by Google