The SIMLIN Procedure

Example 31.2 Multipliers for a Third-Order System

(View the complete code for this example.)

This example shows how to fit and simulate a single-equation dynamic model with third-order lags. It then shows how to convert the third-order equation into a three-equation system with only first-order lags, so that the SIMLIN procedure can compute multipliers. (For more information, see the section Multipliers for Higher-Order Lags.)

The input data set TEST is created from simulated data. A partial listing of the data set TEST produced by PROC PRINT is shown in Output 31.2.1.

Output 31.2.1: Partial Listing of Input Data Set

Simulate Equation with Third-Order Lags
Listing of Simulated Input Data

Obsyylag1ylag2ylag3xn
18.23698.51916.94917.8800-1.25931
28.62858.23698.51916.9491-1.68052
310.22238.62858.23698.5191-1.98443
410.137210.22238.62858.2369-1.78554
510.036010.137210.22238.6285-1.80925
610.356010.036010.137210.2223-1.39216
711.483510.356010.036010.1372-2.09877
810.850811.483510.356010.0360-1.87888
911.268410.850811.483510.3560-1.71549
1012.631011.268410.850811.4835-1.841810


The REG procedure processes the input data and writes the parameter estimates to the OUTEST= data set A.

title2 'Estimated Parameters';
proc reg data=test outest=a;
   model y=ylag3 x;
run;

title2 'Listing of OUTEST= Data Set';
proc print data=a;
run;

Output 31.2.2 shows the printed output produced by the REG procedure, and Output 31.2.3 displays the OUTEST= data set A that is produced.

Output 31.2.2: Estimates and Fit Information from PROC REG

Simulate Equation with Third-Order Lags
Estimated Parameters

The REG Procedure
Model: MODEL1
Dependent Variable: y

Analysis of Variance
SourceDFSum of
Squares
Mean
Square
F ValuePr > F
Model2173.9837786.991891691.98<.0001
Error271.388180.05141  
Corrected Total29175.37196   

Root MSE0.22675R-Square0.9921
Dependent Mean13.05234Adj R-Sq0.9915
Coeff Var1.73721  

Parameter Estimates
VariableDFParameter
Estimate
Standard
Error
t ValuePr > |t|
Intercept10.142390.236570.600.5523
ylag310.771210.0172344.77<.0001
x1-1.776680.10843-16.39<.0001


Output 31.2.3: The OUTEST= Data Set Created by PROC REG

Simulate Equation with Third-Order Lags
Listing of OUTEST= Data Set

Obs_MODEL__TYPE__DEPVAR__RMSE_Interceptylag3xy
1MODEL1PARMSy0.226750.142390.77121-1.77668-1


The SIMLIN procedure processes the TEST data set using the estimates from PROC REG. The following statements perform the simulation and write the results to the OUT= data set OUT2:

title2 'Simulation of Equation';
proc simlin est=a data=test nored;
   endogenous y;
   exogenous  x;
   lagged ylag3 y 3;
   id n;
   output out=out1 predicted=yhat residual=yresid;
run;

The printed output from the SIMLIN procedure is shown in Output 31.2.4.

Output 31.2.4: Output Produced by PROC SIMLIN

Simulate Equation with Third-Order Lags
Simulation of Equation

The SIMLIN Procedure

Fit Statistics
VariableNMean ErrorMean Pct
Error
Mean Abs ErrorMean Abs
Pct Error
RMS
Error
RMS Pct
Error
y30-0.0233-0.22680.26622.056840.34082.6159


The following statements plot the actual and predicted values, as shown in Output 31.2.5:

title2 'Plots of Simulation Results';
proc sgplot data=out1;
   scatter x=n y=y;
   series x=n y=yhat / markers markerattrs=(symbol=plus);
run;

Output 31.2.5: Plot of Predicted and Actual Values

Plot of Predicted and Actual Values


Next, the input data set TEST is modified by creating two new variables, YLAG1X and YLAG2X, that are equal to YLAG1 and YLAG2. These variables are used in the SYSLIN procedure. (The estimates produced by PROC SYSLIN are the same as before and are not shown.) A listing of the OUTEST= data set B created by PROC SYSLIN is shown in Output 31.2.6.

data test2;
   set test;
   ylag1x=ylag1;
   ylag2x=ylag2;
run;
title2 'Estimation of parameters and definition of identities';
proc syslin data=test2 outest=b;
   endogenous y ylag1x ylag2x;
   model y=ylag3 x;
   identity ylag1x=ylag1;
   identity ylag2x=ylag2;
run;

title2 'Listing of OUTEST= data set from PROC SYSLIN';
proc print data=b;
run;

Output 31.2.6: Listing of OUTEST= Data Set Created from PROC SYSLIN

Simulate Equation with Third-Order Lags
Listing of OUTEST= data set from PROC SYSLIN

Obs_TYPE__STATUS__MODEL__DEPVAR__SIGMA_Interceptylag3xylag1ylag2yylag1xylag2x
1OLS0 Convergedyy0.226750.142390.77121-1.77668..-1..
2IDENTITY0 Converged ylag1x.0.00000..1..-1.
3IDENTITY0 Converged ylag2x.0.00000...1..-1


The SIMLIN procedure is used to compute the reduced form and multipliers. The OUTEST= data set B from PROC SYSLIN is used as the EST= data set for the SIMLIN procedure. The following statements perform the multiplier analysis:

title2 'Simulation of transformed first-order equation system';

proc simlin est=b data=test2 total interim=2;
   endogenous y ylag1x ylag2x;
   exogenous  x;
   lagged  ylag1 y 1  ylag2 ylag1x 1  ylag3 ylag2x 1;
   id n;
   output out=out2 predicted=yhat residual=yresid;
run;

Output 31.2.7 shows the interim 2 and total multipliers printed by the SIMLIN procedure.

Output 31.2.7: Interim 2 and Total Multipliers

Simulate Equation with Third-Order Lags
Simulation of transformed first-order equation system

The SIMLIN Procedure

Interim Multipliers for Interim 2
VariablexIntercept
y0.0000000.0000000
ylag1x0.0000000.0000000
ylag2x-1.7766820.1423865

Total Multipliers
VariablexIntercept
y-7.7655560.6223455
ylag1x-7.7655560.6223455
ylag2x-7.7655560.6223455


Last updated: August 25, 2017