IMSLS_REGRESSION, intn_regressors, floatx[] (Input) Array of length n_obs×n_regressors 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_regressors = 0 (No regression variables are included).
IMSLS_REGRESSION_FORECASTS, floatxlead[] (Input) Array of length n_predict×n_regressors 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_REGRESSION_INDICES, int n_indices, intindices[] (Input) Argument n_indices 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_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 no trend on the model in the original, undifferenced space is polynomial of order d.
Default: The function will include a trend variable.
IMSLS_MAX_ITERATIONS, intmax_iterations (Input) Maximum number of iterations.
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 forecast and forecast_variance are provided by 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 containing the standard errors of the ARMA parameter estimates, where p = model[0] and q = 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. If model[0]+model[2]= 0 and n_regressors > 0, avar is the mean squared regression residual.
IMSLS_SE_COEF, float**regcoef_std_error(Output) Address of a pointer to an internally allocated array of length n_regressors+t containing the standard errors of the ARMA parameter estimates, 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 –2(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 containing the final autoregressive parameter estimates, and ma is an array of length q containing the final moving average parameter estimates.
Description
Function imsls_f_regression_arima fits an ARIMA(p, d, q) to a univariate 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 .
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.
To estimate the (p + q + K) parameters of the specified regression ARIMA model, imsls_f_regression_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 matrix with i-th column, , 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) with parameters and . At iteration m, the second step is then to obtain new estimates of and for the updated series, . To find the estimates and , imsls_f_regression_arima uses the exact likelihood method as described in Akaike, Kitagawa, Arahata and Tada (1979) and used in function, imsls_f_max_arma.
Remarks
When forecasts are requested (n_predict > 0), imsls_f_regression_arima requires that future values of the independent variables be provided in optional argument IMSLS_REGRESSION_FORECASTS. In effect, imsls_f_regression_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_regression_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_regression_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 1000’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.
result = imsls_f_regression_arima (nobs, y, model,
IMSLS_REGRESSION,2, regX,
IMSLS_REGRESSION_FORECASTS, ®X[24][0],
IMSLS_FORECASTS, n_predict, &fcst, &fcst_var,
IMSLS_REGRESSION_INDICES, 1, indices,
IMSLS_VAR_NOISE, &avar,
IMSLS_LOG_LIKELIHOOD, &llike,
IMSLS_REGRESSION_COEF, ®coef,
IMSLS_SE_COEF, ®stderr,
IMSLS_COEF_COVARIANCES, &coefcovar,
IMSLS_SE_ARMA, &armastderr,
IMSLS_PRINT_LEVEL, 1,
0);
}
Output
Final results for regression ARIMA model (p,d,q) = 1, 0, 0s
Final AR parameter estimates/ std errors
0.73000 0.13498
-2*ln(maximum log likelihood) = 231.835464
White noise variance = 15427.915039
Regression estimates:
COEFFICIENTS Regression STD Errors
0 -3483.13306 687.21167
1 0.54244 0.02666
Forecasts with standard deviation
T Y fcst Y fcst std dev
24 12360.51563 124.20916
25 12514.80664 153.78410
26 12673.78906 167.42434
27 12837.66895 174.25776
28 12991.60547 177.79208
Example 2
The data set consists of simulated weekly observations containing a strong annual seasonality. The seasonal variables are constructed and sent into regression_arima as regression variables.