IMSLS_SEASONAL_MODEL, intsper, intseasonal_model[] (Input) Argument sper specifies the seasonal period, with sper≥ 0. Argument seasonal_model is an array of length 3 containing the seasonal model order parameters P, D, Q.
Element
Description
0
Order of the autoregressive part, P, where P≥ 0.
1
Order of the non-seasonal difference operator, D, where D≥ 0.
2
Order of the moving average part, Q, where Q≥ 0.
Default: P = D = Q = 0.
IMSLS_REGRESSION, intn_cols, floatx[] (Input) Array of length n_obs×n_cols containing the regression variables. Specific columns of x may be selected using the optional argument IMSLS_REGRESSION_INDICES.
If optional arguments IMSLS_FORECASTS and IMSLS_REGRESSION are present, then IMSLS_REGRESSION_FORECASTS is required.
Default: n_cols = 0 (No regression variables are included).
IMSLS_REGRESSION_INDICES, int n_regressors, intindices[] (Input) Argument n_regressors specifies the length of array indices and the number of regression variables to be included in the ARIMA fit. Argument indices contains the indices of the regression variables in matrices x and xlead.
Default: All regression variables in x and xlead will be used.
IMSLS_REGRESSION_FORECASTS, floatxlead[] (Input) Array of length n_predict×n_cols containing the regression variables to be used in obtaining forecasts. Specific columns of xlead may be selected using the optional argument IMSLS_REGRESSION_INDICES.
If optional arguments IMSLS_FORECASTS and IMSLS_REGRESSION are present, then IMSLS_REGRESSION_FORECASTS is required.
Default: Not used.
IMSLS_INITIAL_EST_INPUT, intn_params, floatparams[] (Input) Array of length n_params containing initial estimates for the parameters. Note that n_params must be equal to p+q+P+Q. The order of each parameter must be as stated, i.e. first the p autoregressive (AR) and q moving average (MA) parameters, followed by the P seasonal AR and Q seasonal MA parameters.
Default: Initial estimates are set by the program.
IMSLS_NO_TREND, (Input) If IMSLS_NO_TREND is specified, the function will not include a trend variable. A trend variable has the effect of fitting an intercept term in the regression. If the difference operator model[1] = d > 0, the effect of trend on the model in the original, undifferenced space is polynomial of order d.
Default: The function includes a trend variable.
IMSLS_MAX_ITERATIONS, intmax_iterations (Input) Maximum number of iterations.
IMSLS_DIFFERENCES, float **differences (Output) Address of a pointer to an internally allocated array of length n_obs ‑ model[1] ‑ seasonal_model[1]*sper containing the differenced series.
IMSLS_DIFFERENCES_USER, floatdifferences[] (Output) Storage for the array differences is provided by user.
IMSLS_FORECASTS, intn_predict, float**forecasts, float**forecast_variances (Output) Addresses of pointers to internally allocated arrays of length n_predict containing the forecasts and forecast variances for time points t = n+1, n+2, …, n+n_predict, where n = n_obs.
If optional arguments IMSLS_FORECASTS and IMSLS_REGRESSION are present, then IMSLS_REGRESSION_FORECASTS is required.
IMSLS_FORECASTS_USER, intn_predict, floatforecasts[], floatforecast_variances[](Output) Storage arrays forecasts and forecast_variances are provided by the user. See IMSLS_FORECASTS.
IMSLS_REGRESSION_COEF, float**coefficients(Output) Address of a pointer to an internally allocated array of length n_regressors+t containing the estimated regression coefficients, where t = 0 if IMSLS_NO_TREND is specified, otherwise t = 1.
IMSLS_REGRESSION_COEF_USER, floatcoefficients[](Output) Storage array coefficients is provided by user. See IMSLS_REGRESSION_COEF.
IMSLS_SE_ARMA, float**arma_std_errors(Output) Address of a pointer to an internally allocated array of length p+q+P+Q containing the standard errors of the ARMA parameter estimates, where p = model[0], q = model[2], P = seasonal_model[0] and Q = seasonal_model[2].
IMSLS_SE_ARMA_USER, floatarma_std_errors[](Output) Storage array arma_std_errors is provided by user. See IMSLS_SE_ARMA.
IMSLS_VAR_NOISE, float*avar(Output) White noise variance estimate. For a regression-only model (p=q=P=Q=0), avar is the mean squared regression residual for w_t, the time series after applying any differencing.
IMSLS_SE_COEF, float**regcoef_std_errors(Output) Address of a pointer to an internally allocated array of length n_regressors+t containing the standard errors of the regression coefficients, where t = 0 if IMSLS_NO_TREND is specified, otherwise t = 1.
IMSLS_SE_COEF_USER, floatregcoef_std_errors[](Output) Storage array regcoef_std_errors is provided by user. See IMSLS_SE_COEF.
IMSLS_COEF_COVARIANCES, float**coef_covar(Output) Address of a pointer to an internally allocated array of length (n_regressors+t)× (n_regressors+t) containing the variances and covariances of the regression coefficients, where t = 0 if IMSLS_NO_TREND is specified, otherwise t = 1.
IMSLS_COEF_COVARIANCES_USER, floatcoef_covar[](Output) Storage array coef_covar is provided by user. See IMSLS_COEF_COVARIANCES.
IMSLS_AIC, float*aic(Output) Akaike’s Information Criterion for the fitted ARMA model.
IMSLS_LOG_LIKELIHOOD, float*log_likelihood(Output) Value of ln(likelihood) for fitted model.
IMSLS_RETURN_USER, float*constant, floatar[], floatma[] (Output) If specified, constant is the constant parameter estimate, ar is an array of length p+P containing the final autoregressive parameter estimates, and ma is an array of length q+Q containing the final moving average parameter estimates.
Description
Function imsls_f_arima fits a seasonal or non-seasonal ARIMA time series with the possible inclusion of one or more regression variables.
Suppose , , is a time series such that the d-th difference is stationary. Further, suppose is a series of uncorrelated, mean 0 random variables with variance .
First, for the non-seasonal case, the Auto-Regressive Integrated Moving Average (ARIMA) model for can be expressed as
where B is the backshift operator,
and
The notation for this model is ARIMA(p, d, q) where p is the order of the autoregressive polynomial , d is the order of the differencing needed to make stationary, and q is the order of the moving-average polynomial .
The ARIMA model can be extended to include regression variables , by using the residuals (of the multiple regression of on ) in place of in the above ARIMA model:
Equivalently,
where
is the differenced residual series. Note that if IMSLS_NO_TREND is specified, β0 will be 0.
To estimate the p + q + K (and + 1 for trend) parameters of the specified regression ARIMA model, imsls_f_arima uses the iterative generalized least squares method (IGLS) as described in Otto, Bell, and Burman (1987).
The IGLS method iterates between two steps, one step to estimate the regression parameters via generalized least squares (GLS) and the second step to estimate the ARMA parameters. In particular, at iteration m, the first step finds
by solving the GLS problem with weight matrix
where
That is, minimizes , where , is an N by K + 1 matrix with i-th column, , , and , and is an N by N weight matrix defined using the theoretical autocovariances of the series
The series is modeled as an ARMA(p,q) process with parameters and . At iteration m, the second step is then to obtain new estimates of and for the updated series, . The function then finds the maximum likelihood estimates, and , by minimizing the negative log-likelihood over the parameter vector. The log-likelihood is calculated using the innovations algorithm as described in Brockwell & Davis, Chapter 8.
The method is essentially the same for a seasonal ARIMA model. The notation for a seasonal model is ARIMA (p, d, q)x(P, D, Q)s where P is the order of the seasonal autoregressive polynomial, D (along with d) is the order of the differencing needed for stationarity, Q is the order of the seasonal moving-average polynomial, and s is the seasonal period. In particular, the seasonal ARIMA model has the form
φ(B)(Bs)wt=θ(B)Θ(Bs)at
where wt= (1 ‑B)d (1‑Bs)D , d,D≥0 are the difference orders, s≥1 is an integer specifying the seasonal period, and at is the white noise process as before. The seasonal autoregressive and moving average polynomials are given by
(Bs) = 1‑1Bs‑2B2s‑⋯‑pBPs
and
Θ(Bs) = 1‑Θ1Bs‑Θ2B2s‑⋯‑ΘQBQs
respectively.
Remarks
When forecasts are requested (n_predict > 0), imsls_f_arima requires that future values of the independent variables be provided in optional argument IMSLS_REGRESSION_FORECASTS. In effect, imsls_f_arima assumes the future X’s are known without error, which is valid for any deterministic function of time such as a seasonal indicator. Also, in economics, certain factors that are considered to be leading indicators are treated as deterministic for the purpose of predicting changes in the economy. Users may consider using a more general transfer function model if this is an unreasonable assumption. Function imsls_f_arima calculates forecast variances using the asymptotic result found in Fuller (1996), Theorem 2.9.4. To obtain the standard errors of the ARMA parameters, imsls_f_arima calls function imsls_f_arma for the final w series.
Examples
Example 1
The data set consists of annual mileage per passenger vehicle and annual US population (in 10000’s) spanning the years 1980 to 2006 (U.S. Energy Information Administration, 2008). Consider modeling the annual mileage using US population as a regression variable.
Final results for ARIMA model (p,d,q)x(P,D,Q)_s = (1,0,0)x(0,0,0)_0
Final AR parameter estimates/ std errors
0.56471 0.13500
-2*ln(maximum log likelihood) = 299.944427
White noise variance = 15425.566406
Regression estimates:
COEFFICIENTS Regression STD Errors
0 -3480.87573 689.33929
1 0.54236 0.02674
Forecasts with standard deviation
T Y fcst Y fcst std dev
24 12368.37207 124.19970
25 12524.92871 142.63528
26 12683.60254 148.03239
27 12846.14355 149.71263
28 12998.47363 150.24451
Example 2
The data set consists of simulated weekly observations containing a strong annual seasonality. The seasonal variables are constructed and sent into imsls_f_arima as regression variables.
Final results for ARIMA model (p,d,q)x(P,D,Q)_s = (2,0,0)x(0,0,0)_0
Final AR parameter estimates/ std errors
0.71727 0.09837
-0.26694 0.09828
-2*ln(maximum log likelihood) = 270.166840
White noise variance = 0.868012
Regression estimates:
COEFFICIENTS Regression STD Errors
0 24.81011 0.17172
1 8.91972 0.24034
2 6.84813 0.24701
Forecasts with standard deviation
T Y fcst Y fcst std dev
100 26.74694 0.93167
101 28.07994 1.14655
102 29.33769 1.16952
103 30.53127 1.16959
Example 3
The data set consists of the number of monthly accidental deaths in the USA from 1973 to 1978 (Brockwell & Davis, 2006). The following example fits a (0,1,1)x(0,1,1) ARIMA model with seasonal period = 12. With monthly data, a seasonal period of 12 corresponds to an annual seasonal cycle.