Computes forecasts, their associated probability limits and weights for an outlier contaminated time series whose underlying outlier free series follows a general seasonal or nonseasonal ARMA model.
The type double function is imsls_d_ts_outlier_forecast.
Required Arguments
int n_obs (Input) Number of observations in the time series.
float series[] (Input) An array of length n_obs by 2 containing the outlier free time series in its first column and the residuals of the series in the second column.
intnum_outliers (Input) Number of detected outliers in the original outlier contaminated series as computed in imsls_f_ts_outlier_identification.
intoutlier_statistics[] (Input) An array of length num_outliers by 2 containing the outlier statistics from imsls_f_ts_outlier_identification. If num_outliers=0, this array is ignored.
float omega[] (Input) Array of length num_outliers containing the weights for the outliers determined in imsls_f_ts_outlier_identification. Ignored, if num_outliers=0.
floatdelta (Input) The dynamic dampening effect parameter used in the outlier detection.
int model[] (Input) Vector of length 4 containing the numbers p, q, s, d of the ARIMA model the outlier free series is following.
float parameters[] (Input) Vector of length 1+p+q containing the estimated constant, AR and MA parameters as output from imsls_f_ts_outlier_identification.
int n_predict (Input) Maximum lead time for forecasts. The forecasts are taken at origin t=n_obs, the time point of the last observed value, for lead times 1,2,...,n_predict.
Return Value
Pointer to an array of length n_predict by 3. The first column contains the forecasted values for the original outlier contaminated series. The second column contains the deviations from each forecast for computing confidence probability limits, and the third column contains the weights of the infinite moving average form of the model.
IMSLS_RETURN_USER, floatforecast[] (Output) An array of length n_predict by 3 supplied by the user containing the forecasts for the original outlier contaminated series in column 1, deviations from each forecast in column 2 and the weights of the infinite moving average form of the model in column 3.
IMSLS_CONFIDENCE, floatconfidence (Input) Value in the exclusive interval (0,100) used to specify the confidence percent probability limits of the forecast.Typical choices for confidence are 90.0, 95.0 and 99.0.
Default: confidence = 95.0
IMSLS_OUT_FREE_FORECAST, float**outfree_forecast (Output) Address of a pointer to an array of length n_predict by 3 containing the forecasts for the original outlier free series in column 1, deviations from each forecast in column 2 and the weights of the infinite moving average form of the model in column 3.
IMSLS_OUT_FREE_FORECAST_USER, floatoutfree_forecast[] (Output) Storage for array outfree_forecast is provided by the user. For a description, see IMSLS_OUT_FREE_FORECAST.
Description
Consider the following model for a given outlier contaminated univariate time series :
For an explanation of the notation, see the Description section for imsls_f_ts_outlier_identification. It follows from the formula above that the Box-Jenkins forecast at origin for lead time , , can be computed as:
Therefore, computation of the forecasts for is done in two steps:
1. Computation of the forecasts for the outlier free series .
2. Computation of the forecasts for the original series by adding the multiple outlier effects to the forecasts for .
Step 1 above:
Since
where
the Box-Jenkins forecast at origin for lead time , , can be computed recursively as:
Here,
and
Step 2 above:
The formulas for for the different types of outliers are as follows:
Innovational outliers (IO)
Additive outliers (AO)
Level shifts (LS)
Temporary changes (TC)
Assuming the outlier occurs at time point , the outlier impact is therefore:
Innovational outliers (IO)
Additive outliers (AO)
Level shifts (LS)
Temporary changes (TC)
From these formulas, the forecasts can be computed easily.
The percent probability limits for and are given by
where is the percentile of the standard normal distribution, is an estimate of the variance of the random shocks (returned from imsls_f_ts_outlier_identification), and the weights are the coefficients in
For a detailed explanation of these concepts, see Chapter 5, Forecasting, Box, Jenkins and Reinsel (1994).
Example
This example is a realization of an ARMA(2,1) process described by the model , a Gaussian white noise process.
Outliers were artificially added to the outlier free series {Yt}t=1, ...,280 at time points (level shift, ) and (additive outlier, ), resulting in the outlier contaminated series {Zt}t=1, ...,280. For both series, forecasts were determined for time points t=281, ..., 290 and compared with the actual values of the series.