Main Content

Estimate ARIMA Models

This example shows how to estimate autoregressive integrated moving average (ARIMA) models.

Models of time series containing non-stationary trends (seasonality) are sometimes required. One category of such models are the ARIMA models. These models contain a fixed integrator in the noise source. Thus, if the governing equation of an ARMA model is expressed as A(q)y(t)=Ce(t), where A(q) represents the auto-regressive term and C(q) the moving average term, the corresponding model of an ARIMA model is expressed as

A(q)y(t)=C(q)(1-q-1)e(t)

where the term 11-q-1 represents the discrete-time integrator. Similarly, you can formulate the equations for ARI and ARIX models.

Using time-series model estimation commands ar, arx and armax you can introduce integrators into the noise source e(t). You do this by using the IntegrateNoise parameter in the estimation command.

The estimation approach does not account any constant offsets in the time-series data. The ability to introduce noise integrator is not limited to time-series data alone. You can do so also for input-output models where the disturbances might be subject to seasonality. One example is the polynomial models of ARIMAX structure:

A(q)y(t)=B(q)u(t)+C(q)(1-q-1)e(t)

See the armax reference page for examples.

Estimate an ARI model for a scalar time-series with linear trend.

load iddata9 z9
Ts = z9.Ts;
y = cumsum(z9.y);
model = ar(y,4,'ls','Ts',Ts,'IntegrateNoise', true);
% 5 step ahead prediction
compare(y,model,5)

Figure contains an axes object. The axes object with ylabel y1 contains 2 objects of type line. These objects represent Validation data (y1), model: 78.76%.

Estimate a multivariate time-series model such that the noise integration is present in only one of the two time series.

load iddata9 z9
Ts = z9.Ts;
y = z9.y;
y2 = cumsum(y);
% artificially construct a bivariate time series
data = iddata([y, y2],[],Ts); na = [4 0; 0 4];
nc = [2;1];
model1 = armax(data, [na nc], 'IntegrateNoise',[false; true]);
% Forecast the time series 100 steps into future
yf = forecast(model1,data(1:100), 100);
plot(data(1:100),yf)

Figure contains 2 axes objects. Axes object 1 with title y1 contains 2 objects of type line. These objects represent untitled1, yf. Axes object 2 with title y2 contains 2 objects of type line. These objects represent untitled1, yf.

If the outputs were coupled ( na was not a diagonal matrix), the situation will be more complex and simply adding an integrator to the second noise channel will not work.