The SIMLIN Procedure

Example 31.1 Simulating Klein’s Model I

(View the complete code for this example.)

In this example, the SIMLIN procedure simulates a model of the U.S. economy called Klein’s Model I. The SAS data set KLEIN is used as input to the SYSLIN and SIMLIN procedures.

data klein;
   input year c p w i x wp g t k wsum;
   date=mdy(1,1,year);
   format date year.;
   y   = c + i + g - t;
   yr  = year - 1931;
   klag = lag( k );
   plag = lag( p );
   xlag = lag( x );
   if year >= 1921;
   label c   ='consumption'
         p   ='profits'
         w   ='private wage bill'
         i   ='investment'
         k   ='capital stock'
         y   ='national income'
         x   ='private production'
         wsum='total wage bill'
         wp  ='govt wage bill'
         g   ='govt demand'
         t   ='taxes'
         klag='capital stock lagged'
         plag='profits lagged'
         xlag='private product lagged'
         yr  ='year-1931';
datalines;
1920     .  12.7     .    .  44.9    .     .     .  182.8     .
1921  41.9  12.4  25.5 -0.2  45.6  2.7   3.9   7.7  182.6  28.2

   ... more lines ...   

First, the model is specified and estimated using the SYSLIN procedure, and the parameter estimates are written to an OUTEST= data set. The printed output produced by the SYSLIN procedure is not shown here; see Example 36.1 in Chapter 36 for the printed output of the PROC SYSLIN step.

title1 'Simulation of Klein''s Model I using SIMLIN';
proc syslin 3sls data=klein outest=a;

   instruments klag plag xlag wp g t yr;
   endogenous c p w i x wsum k y;

   consume: model    c = p plag wsum;
   invest:  model    i = p plag klag;
   labor:   model    w = x xlag yr;

   product: identity x = c + i + g;
   income:  identity y = c + i + g - t;
   profit:  identity p = x - w - t;
   stock:   identity k = klag + i;
   wage:    identity wsum = w + wp;
run;

The OUTEST= data set A created by the SYSLIN procedure contains parameter estimates to be used by the SIMLIN procedure. The OUTEST= data set is shown in Output 31.1.1.

Output 31.1.1: The OUTEST= Data Set Created by PROC SYSLIN

Simulation of Klein's Model I using SIMLIN

Obs_TYPE__STATUS__MODEL__DEPVAR__SIGMA_Interceptklagplagxlagwpgtyrcpwixwsumky
1INST0 ConvergedFIRSTc2.1140358.3018-0.146540.748030.230070.193270.20501-0.365730.70109-1.......
2INST0 ConvergedFIRSTp2.1829850.3844-0.216100.802500.02200-0.079610.43902-0.923100.31941.-1.00000......
3INST0 ConvergedFIRSTw1.7542743.4356-0.122950.871920.09533-0.443730.86622-0.604150.71358..-1.....
4INST0 ConvergedFIRSTi1.7237635.5182-0.192510.92639-0.11274-0.716610.10023-0.161520.33190...-1....
5INST0 ConvergedFIRSTx3.7734793.8200-0.339061.674420.11733-0.523341.30524-0.527251.03299....-1.00000...
6INST0 ConvergedFIRSTwsum1.7542743.4356-0.122950.871920.095330.556270.86622-0.604150.71358.....-1.00000..
7INST0 ConvergedFIRSTk1.7237635.51820.807490.92639-0.11274-0.716610.10023-0.161520.33190......-1.
8INST0 ConvergedFIRSTy3.7734793.8200-0.339061.674420.11733-0.523341.30524-1.527251.03299.......-1
93SLS0 ConvergedCONSUMEc1.0495616.4408.0.16314.....-10.12489...0.79008..
103SLS0 ConvergedINVESTi1.6079628.1778-0.194850.75572......-0.01308.-1....
113SLS0 ConvergedLABORw0.801491.7972..0.18129...0.14967..-1.0.40049...
12IDENTITY0 ConvergedPRODUCTx.0.0000....1.00000..1..1-1.00000...
13IDENTITY0 ConvergedINCOMEy.0.0000....1.00000-1.00000.1..1...-1
14IDENTITY0 ConvergedPROFITp.0.0000.....-1.00000..-1.00000-1.1.00000...
15IDENTITY0 ConvergedSTOCKk.0.00001.00000.........1..-1.
16IDENTITY0 ConvergedWAGEwsum.0.0000...1.00000.....1..-1.00000..


Using the OUTEST= data set A produced by the SYSLIN procedure, the SIMLIN procedure can now compute the reduced form and simulate the model. The following statements perform the simulation:

title1 'Simulation of Klein''s Model I using SIMLIN';
proc simlin data=klein
            est=a type=3sls
            estprint
            total interim=2
            outest=b;
   endogenous c p w i x wsum k y;
   exogenous  wp g t yr;
   lagged  klag k 1   plag p 1   xlag x 1;
   id year;
   output out=c p=chat phat what ihat xhat wsumhat khat yhat
                r=cres pres wres ires xres wsumres kres yres;
run;

The reduced form coefficients and multipliers are added to the information read from EST= data set A and written to the OUTEST= data set B. The predicted and residual values from the simulation are written to the OUT= data set C specified in the OUTPUT statement.

The SIMLIN procedure first prints the structural coefficient matrices read from the EST= data set, as shown in Output 31.1.2 through Output 31.1.4.

Output 31.1.2: SIMLIN Procedure Output — Endogenous Structural Coefficients

Simulation of Klein's Model I using SIMLIN

The SIMLIN Procedure

Structural Coefficients for Endogenous Variables
Variablecpwixwsumky
c1.0000-0.1249...-0.7901..
i.0.0131.1.0000....
w..1.0000.-0.4005...
x-1.0000..-1.00001.0000...
y-1.0000..-1.0000...1.0000
p.1.00001.0000.-1.0000...
k...-1.0000..1.0000.
wsum..-1.0000..1.0000..


Output 31.1.3: SIMLIN Procedure Output — Lagged Endogenous Structural Coefficients

Structural Coefficients for Lagged Endogenous
Variables
Variableklagplagxlag
c.0.1631.
i-0.19480.7557.
w..0.1813
x...
y...
p...
k1.0000..
wsum...


Output 31.1.4: SIMLIN Procedure Output — Exogenous Structural Coefficients

Structural Coefficients for Exogenous Variables
VariablewpgtyrIntercept
c....16.4408
i....28.1778
w...0.14971.7972
x.1.0000..0
y.1.0000-1.0000.0
p..-1.0000.0
k....0
wsum1.0000...0


The SIMLIN procedure then prints the inverse of the endogenous variables coefficient matrix, as shown in Output 31.1.5.

Output 31.1.5: SIMLIN Procedure Output — Inverse Coefficient Matrix

Inverse Coefficient Matrix for Endogenous Variables
Variableciwxypkwsum
c1.63470.63471.09570.634700.195901.2915
p0.97240.9724-0.34050.972401.108700.7682
w0.64960.64961.44060.649600.072600.5132
i-0.01270.98730.004453-0.01270-0.01450-0.0100
x1.62191.62191.10011.621900.181401.2815
wsum0.64960.64961.44060.649600.072601.5132
k-0.01270.98730.004453-0.01270-0.01451.0000-0.0100
y1.62191.62191.10010.62191.00000.181401.2815


The SIMLIN procedure next prints the reduced form coefficient matrices, as shown in Output 31.1.6.

Output 31.1.6: SIMLIN Procedure Output — Reduced Form Coefficients

Reduced Form for Lagged Endogenous Variables
Variableklagplagxlag
c-0.12370.74630.1986
p-0.18950.8935-0.0617
w-0.12660.59690.2612
i-0.19240.74400.000807
x-0.31601.49030.1994
wsum-0.12660.59690.2612
k0.80760.74400.000807
y-0.31601.49030.1994

Reduced Form for Exogenous Variables
VariablewpgtyrIntercept
c1.29150.6347-0.19590.164046.7273
p0.76820.9724-1.1087-0.051042.7736
w0.51320.6496-0.07260.215631.5721
i-0.0100-0.01270.01450.00066727.6184
x1.28151.6219-0.18140.164774.3457
wsum1.51320.6496-0.07260.215631.5721
k-0.0100-0.01270.01450.00066727.6184
y1.28151.6219-1.18140.164774.3457


The multiplier matrices (requested by the INTERIM=2 and TOTAL options) are printed next, as shown in Output 31.1.7 and Output 31.1.8.

Output 31.1.7: SIMLIN Procedure Output — Interim Multipliers

Interim Multipliers for Interim 1
VariablewpgtyrIntercept
c0.8291301.049424-0.865262-.005408043.27442
p0.6092130.771077-0.982167-.055821528.39545
w0.7944881.005578-0.7109610.012501841.45124
i0.5745720.727231-0.827867-.037911726.57227
x1.4037021.776655-1.693129-.043319769.84670
wsum0.7944881.005578-0.7109610.012501841.45124
k0.5645240.714514-0.813366-.037245254.19068
y1.4037021.776655-1.693129-.043319769.84670

Interim Multipliers for Interim 2
VariablewpgtyrIntercept
c0.6636710.840004-0.968727-.045658928.36428
p0.3507160.443899-0.618929-.040144610.79216
w0.6587690.833799-0.925467-.039917828.33114
i0.3458130.437694-0.575669-.034403510.75901
x1.0094851.277698-1.544396-.080062439.12330
wsum0.6587690.833799-0.925467-.039917828.33114
k0.9103371.152208-1.389035-.071648664.94969
y1.0094851.277698-1.544396-.080062439.12330


Output 31.1.8: SIMLIN Procedure Output — Total Multipliers

Total Multipliers
VariablewpgtyrIntercept
c1.8816671.381613-0.6859870.178962441.3045
p0.7869450.996031-1.286891-.074829015.4770
w1.0947221.385582-0.3990950.253791425.8275
i0.0000000.000000-0.0000000.00000000.0000
x1.8816672.381613-0.6859870.178962441.3045
wsum2.0947221.385582-0.3990950.253791425.8275
k2.9993653.796275-4.904859-.2852032203.6035
y1.8816672.381613-1.6859870.178962441.3045


The last part of the SIMLIN procedure output is a table of statistics of fit for the simulation, as shown in Output 31.1.9.

Output 31.1.9: SIMLIN Procedure Output — Simulation Statistics

Fit Statistics
VariableNMean ErrorMean Pct
Error
Mean Abs ErrorMean Abs
Pct Error
RMS
Error
RMS Pct
Error
Label
c210.1367-0.38273.50116.697694.31558.1701consumption
p210.1422-4.06712.935519.614003.425726.0265profits
w210.1282-0.89393.12478.921104.093011.4709private wage bill
i210.1337105.85292.4983127.137362.9980252.3497investment
x210.2704-0.95535.962210.400577.188112.5653private production
wsum210.1282-0.66693.12477.889884.093010.1724total wage bill
k21-0.1424-0.15063.88791.906145.00362.4209capital stock
y210.2704-1.34765.962211.741777.188114.2214national income


The OUTEST= output data set contains all the observations read from the EST= data set, and in addition contains observations for the reduced form and multiplier matrices. The following statements produce a partial listing of the OUTEST= data set, as shown in Output 31.1.10:

proc print data=b;
   where _type_ = 'REDUCED' | _type_ = 'IMULT1';
run;

Output 31.1.10: Partial Listing of OUTEST= Data Set

Simulation of Klein's Model I using SIMLIN

Obs_TYPE__DEPVAR__MODEL__SIGMA_cpwixwsumkyklagplagxlagwpgtyrIntercept
9REDUCEDc .1.634650.634651.095660.6346500.1958501.29151-0.123660.746310.198631.291510.63465-0.195850.1639946.7273
10REDUCEDp .0.972360.97236-0.340480.9723601.1087200.76825-0.189460.89347-0.061730.768250.97236-1.10872-0.0509642.7736
11REDUCEDw .0.649570.649571.440590.6495700.0726300.51321-0.126570.596870.261170.513210.64957-0.072630.2156231.5721
12REDUCEDi .-0.012720.987280.00445-0.012720-0.014500-0.01005-0.192370.744040.00081-0.01005-0.012720.014500.0006727.6184
13REDUCEDx .1.621941.621941.100111.6219400.1813501.28146-0.316031.490340.199441.281461.62194-0.181350.1646674.3457
14REDUCEDwsum .0.649570.649571.440590.6495700.0726301.51321-0.126570.596870.261171.513210.64957-0.072630.2156231.5721
15REDUCEDk .-0.012720.987280.00445-0.012720-0.014501-0.010050.807630.744040.00081-0.01005-0.012720.014500.0006727.6184
16REDUCEDy .1.621941.621941.100110.6219410.1813501.28146-0.316031.490340.199441.281461.62194-1.181350.1646674.3457
17IMULT1c ............0.829131.04942-0.86526-0.0054143.2744
18IMULT1p ............0.609210.77108-0.98217-0.0558228.3955
19IMULT1w ............0.794491.00558-0.710960.0125041.4512
20IMULT1i ............0.574570.72723-0.82787-0.0379126.5723
21IMULT1x ............1.403701.77666-1.69313-0.0433269.8467
22IMULT1wsum ............0.794491.00558-0.710960.0125041.4512
23IMULT1k ............0.564520.71451-0.81337-0.0372554.1907
24IMULT1y ............1.403701.77666-1.69313-0.0433269.8467


The actual and predicted values for the variable C are plotted in Output 31.1.11.

title2 'Plots of Simulation Results';
proc sgplot data=c;
   scatter x=year y=c;
   series x=year y=chat / markers markerattrs=(symbol=plus);
   refline 1941.5 / axis=x;
run;

Output 31.1.11: Plot of Actual and Predicted Consumption

Plot of Actual and Predicted Consumption


Last updated: August 25, 2017