Case Study 4

The AQI index

Quality of a product and the service provided by a Business is
very important. For this particular Company, the product is
manufactured from several components, each of which can be
assessed by Quality Control (QC) methods. In practice, the
individual QC statistics would be combined so as to provide an
overall measure of the Quality of the process itself --- often
referred to as Stochastic Process Control (SPC) [1]. One of the
aims of SPC is to enable the Company to pursue the goal of
so-called ``Continuous Improvement'' [2].

However, for this Company it was of interest to incorporate
the seasonal variation in sales of their products along with
measures of Quality. Based on an inverted quadratic loss
function, the Company developed their own Adjusted Quality
Index (AQI) such that AQI=100 represented the highest possible
value. The ability to redefine what constitutes maximum Quality
combined with Sales means that the Company can always pursue the
goal of Continuous Improvement without changing the AQI scale.

Another purpose of developing the AQI was to provide the Company
with the ability to forecast realistic improvement goals. Thus,
the analysis of interest here is to obtain a good time series
model for the AQI.

The Data

Monthly data for the last 4 years of the AQI Score for a certain
product is given in Table 7.4.1 below. Also included is the BATCH
Count which corresponds to the amount of product manufactured by
the Company

Table: AQI dataset

Month Batch AQI

1/1/94 2339 86.63
2/1/94 2275 84.60
3/1/94 2881 87.04
4/1/94 2780 87.19
5/1/94 3227 87.91
6/1/94 3291 87.99
7/1/94 2944 88.09
8/1/94 3163 88.25
9/1/94 2770 87.62
10/1/94 2827 87.43
11/1/94 2392 86.74
12/1/94 1973 84.86
1/1/95 3006 87.44
2/1/95 2924 87.77
3/1/95 3592 88.09
4/1/95 3460 88.53
5/1/95 3807 88.11
6/1/95 3753 88.59
7/1/95 3648 88.67
8/1/95 3698 88.87
9/1/95 3166 89.92
10/1/95 3159 88.93
11/1/95 2545 87.17
12/1/95 2208 89.07
1/1/96 2971 89.25
2/1/96 3083 90.54
3/1/96 3504 89.89
4/1/96 3580 90.28
5/1/96 3855 89.46
6/1/96 3894 89.42
7/1/96 3772 89.28
8/1/96 3705 89.17
9/1/96 3364 90.42
10/1/96 3341 90.46
11/1/96 2680 88.63
12/1/96 2418 89.74
1/1/97 2963 90.48
2/1/97 2890 89.76
3/1/97 3455 90.20
4/1/97 3747 90.68
5/1/97 3685 90.19
6/1/97 3672 89.78
7/1/97 3865 89.72
8/1/97 3729 90.78
9/1/97 3205 90.32
10/1/97 3158 90.64
11/1/97 2552 90.97
12/1/97 2135 90.23

Methodology

Let $y_t$ denote the response value of interest at time $t$ ---
here, the actual unit of time is months. Suppose we wish to
predict the response at time $t+1$ In a regression situation,
we could let $X$ denote the time index, $Y$ the response values,
and then use the fitted regression model to obtain
${\hat y}_{t+1}$ However, a regression model assumes that
the random components of the model are independent and this is
not a reasonable assumption for a process that evolves over time.
Thus we introduce the ARIMA class of models.

ARIMA Models

The application of the BJ approach to fitting ARIMA model involves
three steps:

1. Identification
Differencing is applied to make the series $y_t$ stationary
2. Estimation
An ARMA(p,q) model is fitted to the differenced series
3. Forecasting
The ARIMA model is used to forecast future values of $y_t$

Seasonal ARIMA Models

The ARIMA class of models can also include seasonal effects by
fitting an ARMA(P,Q) model to observations separated by
the seasonal period. eg. an ARIMA(p,d,q)x(P,D,Q)_12

D = number of seasonal differences applied to $y_t$
P,Q = seasonal ARMA model orders
s = seasonal lag.

d = number of simple differences applied to deseasonalized
series
p,q = deseasonalized ARMA model orders

Stationarity

ARIMA models can often provide a useful starting point and may be
sufficiently accurate for the purposes of the project at hand.
However, these models require that the original series can be
reduced to a stationary series ($w_t$ above) wherein the mean and
variance is constant. In general, mean stationarity can be
achieved by differencing, but to obtain constant variance, a
non-linear transformation may be required.

SAS Notes on PROC ARIMA

The following SAS code presents some generic statements for
ARIMA model specifications in PROC ARIMA :

proc arima ;
i var=y ; * time series y(t) ;
* to detrend use (one of) the following ;
* instead ;
i var=y(1) ; * simple difference w(t) = y(t) - y(t-1) ;
i var=y(12) ; * seasonal difference w(t) = y(t) - y(t-12) ;
i var=y(1,12) ; * simple difference giving w(t), then ;
* seasonal difference giving w2(t): ;
* w2(t) = w(t) - w(t-12) ;

* fitting an arima model ;

e p=(1) ; * fit ar(1) to w(t) ;
e p=(1) plot ; * fit ar(1) and plot the acf/pacf of ;
* residuals ;
e p=(1) q=(1) ; * fit arma(1,1) ;
e p=(1)(12) ; * fit multiplicative ARIMA:
* ar(1) x sar(1) (season lag=12) ;

* forecasting from the fitted arima model ;

f out=r lead=1 back=0 id=t ; * only forecast 1 step ahead.
* data=r output;
f out=r lead=12 id=t ; * forecast 12 steps ahead.
* include forecasts within
* series. output to data=r ;

The SAS program:

options ls=78 formdlim=' ' ;
filename in 'aqi.dat' ;

* sample line entry:
1/1/94 2339 86.63
;

data a ;
infile in ;
input mon mmddyy8. count aqi ;
t = _N_ ;
y = aqi ;
format mon monyy5. ;
retain t ;

proc print ;

proc plot;
plot y*t;

proc arima ;
i var=y(1) ;
e p=(1) plot ;
f out=r lead=12 id=t ;

* detrend simple difference: w(t)=y(t)-y(t-1) ;
* fit ar(1) to w(t). plot acf/pacf of residuals ;
* forecast 12 steps ahead using arima(1,1,0) ;

proc print data=r;
* look at all forecasts and 95% CI's ;

proc gplot ;

endsas ;

Questions

From the initial time series plot it would appear that a
transformation is required to stabilize the variance.

An alternative approach to detrend the series is to fit a
regression and then use an ARIMA model on the residuals.
Compare the resulting forecasts.