Vous êtes sur la page 1sur 2

title1 'International Airline Passengers';

title2 '(Box and Jenkins Series-G)';


data seriesg;
input x @@;
xlog = log( x );
date = intnx( 'month', '31dec1948'd, _n_ );
format date monyy.;
datalines;
112 118 132 129 121 135 148 148 136 119 104
115 126 141 135 125 149 170 170 158 133 114
145 150 178 163 172 178 199 199 184 162 146
171 180 193 181 183 218 230 242 209 191 172
196 196 236 235 229 243 264 272 237 211 180
204 188 235 227 234 264 302 293 259 229 203
242 233 267 269 270 315 364 347 312 274 237
284 277 317 313 318 374 413 405 355 306 271
315 301 356 348 355 422 465 467 404 347 305
340 318 362 348 363 435 491 505 404 359 310
360 342 406 396 420 472 548 559 463 407 362
417 391 419 461 472 535 622 606 508 461 390
;

118
140
166
194
201
229
278
306
336
337
405
432

symbol i=join v=dot;


proc gplot data=seriesg;
plot x * date / haxis= '1jan49'd to '1jan61'd by year;
run;
/*Arima Identification*/
proc arima data=seriesg;
identify var = x;
run;
/*Plot xlog*/
symbol i=join v=dot;
proc gplot data=seriesg;
plot xlog * date / haxis= '1jan49'd to '1jan61'd by year;
run;
/*Arima Identification*/
proc arima data=seriesg;
identify var = xlog stationarity = (Dickey);
run;
/*Arima Identification*/
proc arima data=seriesg;
identify var = xlog(1) stationarity = (Dickey);
run;
/*Taking seasonal difference to remove seasonality*/
data seriesg;
set seriesg;
sdxlog = xlog-lag11(xlog);
odsdxlog = dif(sdxlog);
run;
/*Plot sdxlog*/

symbol i=join v=dot;


proc gplot data=seriesg;
plot sdxlog * date / haxis= '1jan49'd to '1jan61'd by year;
run;
/*Plot odsdxlog*/
symbol i=join v=dot;
proc gplot data=seriesg;
plot odsdxlog * date / haxis= '1jan49'd to '1jan61'd by year;
run;
/*Arima modeling with seasonality*/
proc arima data=seriesg;
identify var = xlog(1,12) stationarity = (Dickey);
run;
estimate q = (1)(12) method = ml;
run;
forecast out=b lead=24 id=date interval=month;
quit;
/*Forecasting back to the original value*/
data c;
set b;
x = exp( xlog );
forecast = exp( forecast + std*std/2 );
l95 = exp( l95 );
u95 = exp( u95 );
run;
symbol1 i=none v=star;
symbol2 i=join v=circle;
symbol3 i=join v=none l=3;
proc gplot data=c;
where date >= '1jan58'd;
plot x * date = 1 forecast * date = 2
l95 * date = 3 u95 * date = 3 /
overlay haxis= '1jan58'd to '1jan62'd by year;
run;
/*Playing with the data*/
/*ARIMA (0 1 1) (0 1 1)12*/
proc arima data=seriesg;
identify var = xlog(1,12);
run;
estimate q = (1)(12) method = ml;
run;
/*Playing with the data*/
/*ARIMA (1 1 1) (1 1 1)12*/
proc arima data=seriesg;
identify var = xlog(1,12)scan esacf;
run;
estimate p = (1)(12) q = (1)(12) method = ml;
run;

Vous aimerez peut-être aussi