Model with Multiple ARIMA Components

/*--------------------------------------------------------------
                    SAS Sample Library

       Name: ssmex06.sas
       Description: Example program from SAS/ETS User's Guide,
              The SSM Procedure
       Title: Model with Multiple ARIMA Components
       Product: SAS/ETS Software
        Keys: RegArima models
        PROC: SSM
        Notes:

--------------------------------------------------------------*/

 title;

 title;

data Test;
  input y hwt;
  date = intnx('month', '01jan1997'd, _n_-1 );
  format date date.;
  logy = log(y);
  label logy = 'Log value of construction put in place';
  datalines;
115.2    0.042
110.4    0.042
111.5    0.067
127.9    0.122
150.0    0.129
149.5    0.135
139.5    0.152
144.6    0.168
176.0    0.173
173.2    0.177
172.7    0.179
143.5    0.179
135.3    0.179
174.5    0.182
164.5    0.179
179.1    0.177
164.8    0.175
168.7    0.170
115.8    0.162
163.7    0.165
156.3    0.152
129.3    0.149
125.5    0.149
120.8    0.135
84.4    0.144
93.6    0.140
83.0    0.144
120.5    0.159
110.9    0.152
115.3    0.149
108.5    0.144
107.7    0.129
99.8    0.144
98.7    0.140
107.7    0.140
102.1    0.149
95.9    0.149
92.2    0.156
99.3    0.152
92.8    0.152
127.4    0.156
105.2    0.165
108.0    0.159
118.1    0.159
108.5    0.159
133.2    0.149
127.3    0.144
110.1    0.144
103.1    0.152
99.8    0.159
101.1    0.156
105.8    0.156
101.6    0.162
110.9    0.156
122.9    0.165
129.8    0.162
129.4    0.165
149.7    0.168
141.4    0.170
125.0    0.159
122.3    0.144
110.3    0.149
108.9    0.144
122.8    0.144
115.8    0.129
116.9    0.135
134.2    0.140
158.8    0.135
141.9    0.149
174.1    0.140
178.6    0.140
154.5    0.115
;

 proc ssm data=Test;
    id date interval=month;
    parm var1=0.016565 / lower=1.e-8;
    trend airlineTrend(arma(d=1 sd=1 q=1 sq=1 s=12)) variance=var1;
    trend ar2Noise(arma(p=2)) cross=(hwt) ar=0.600 0.246 variance=0.34488;
    model logy = airlineTrend ar2Noise;
    output outfor=For;
 run;

 proc sgplot data=For;
     title "Smoothed Estimate of the ARIMA(0,1,1)(0,1,1)12 Trend";
     series x= date y=smoothed_airlineTrend;
     scatter x= date y=logy;
 run;

 proc sgplot data=For;
     title "Smoothed Estimate of the AR(2) Noise";
     series x= date y=smoothed_ar2Noise;
     refline 0;
 run;

 title;