naginterfaces.library.tsa.uni_arima_estim_easy¶
- naginterfaces.library.tsa.uni_arima_estim_easy(mr, par, c, x, nppc, kfc=1, kpiv=0, nit=100, ires=None, io_manager=None)[source]¶
uni_arima_estim_easy
is an easy-to-use version ofuni_arima_estim()
. It fits a seasonal autoregressive integrated moving average (ARIMA) model to an observed time series, using a nonlinear least squares procedure incorporating backforecasting. Parameter estimates are obtained, together with appropriate standard errors. The residual series is returned, and information for use in forecasting the time series is produced for use inuni_arima_update()
anduni_arima_forecast_state()
.The estimation procedure is iterative, starting with initial parameter values such as may be obtained using
uni_arima_prelim()
. It continues until a specified convergence criterion is satisfied or until a specified number of iterations have been carried out. The progress of the iteration can be monitored by means of an optional printing facility.For full information please refer to the NAG Library document for g13af
https://www.nag.com/numeric/nl/nagdoc_28.6/flhtml/g13/g13aff.html
- Parameters
- mrint, array-like, shape
The orders vector of the ARIMA model whose parameters are to be estimated. , , and refer respectively to the number of autoregressive , moving average , seasonal autoregressive and seasonal moving average parameters. , and refer respectively to the order of non-seasonal differencing, the order of seasonal differencing and the seasonal period.
- parfloat, array-like, shape
The initial estimates of the values of the parameters, the values of the parameters, the values of the parameters and the values of the parameters, in that order.
- cfloat
If , must contain the expected value, , of the differenced series.
If , must contain an initial estimate of .
Therefore, if and are both zero on entry, there is no constant correction.
- xfloat, array-like, shape
The values of the original undifferenced time series.
- nppcint
The number of , , , and parameters to be estimated. if the constant is being estimated and if not.
- kfcint, optional
Must be set to if the constant, , is to be estimated and if it is to be held fixed at its initial value.
- kpivint, optional
Must be nonzero if the progress of the optimization is to be monitored using the built-in printing facility. Otherwise must contain zero. If selected, monitoring output will be sent to the file object associated with the advisory I/O unit (see
FileObjManager
). For each iteration, the headingG13AFZ MONITORING OUTPUT - ITERATION n
followed by the argument values, and residual sum of squares, are printed.
- nitint, optional
The maximum number of iterations to be performed.
- iresNone or int, optional
Note: if this argument is None then a default value will be used, determined as follows: .
The dimension of the array .
- io_managerFileObjManager, optional
Manager for I/O in this routine.
- Returns
- parfloat, ndarray, shape
Contains the latest values of the estimates of these parameters.
- cfloat
If , is unchanged.
If , contains the latest estimate of .
- sfloat
The residual sum of squares after the latest series of parameter estimates has been incorporated into the model. If the function exits with a faulty input parameter, contains zero.
- ndfint
The number of degrees of freedom associated with ,
.
- sdfloat, ndarray, shape
The standard deviations corresponding to the parameters in the model ( autoregressive, moving average, seasonal autoregressive, seasonal moving average and , if estimated, in that order). If the function exits with containing a value other than or , or if the required number of iterations is zero, the contents of will be indeterminate.
- cmfloat, ndarray, shape
The correlation coefficients associated with each pair of the parameters. These are held in the first rows and the first columns of . These correlation coefficients are indeterminate if contains on exit a value other than or , or if the required number of iterations is zero.
- stfloat, ndarray, shape
The value of the state set in its first elements. If the function exits with containing a value other than or , the contents of will be indeterminate.
- nstint
The size of the state set. .
should be used subsequently in
uni_arima_update()
anduni_arima_forecast_state()
as the dimension of .- itcint
The number of iterations performed.
- isfint, ndarray, shape
The first four elements of contain success/failure indicators, one for each of the four types of parameter in the model (autoregressive, moving average, seasonal autoregressive, seasonal moving average), in that order.
Each indicator has the interpretation:
On entry parameters of this type have initial estimates which do not satisfy the stationarity or invertibility test conditions.
The search procedure has failed to converge because the latest set of parameter estimates of this type is invalid.
No parameter of this type is in the model.
Valid final estimates for parameters of this type have been obtained.
- resfloat, ndarray, shape
The first elements of contain the model residuals derived from the differenced series. If the function exits with holding a value other than or , these elements of will be indeterminate. The rest of the array is used as workspace.
- nresint
The number of model residuals returned in .
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: or .
- (errno )
The orders vector is invalid.
- (errno )
On entry, .
Constraint: .
- (errno )
The model is over-parameterised.
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, and minimum required size for the state set .
- (errno )
On entry, and the minimum size .
Constraint: .
- Warns
- NagAlgorithmicWarning
- (errno )
A failure in the search procedure has occurred.
- (errno )
The inversion of the Hessian matrix in the calculation of the covariance matrix of the parameter estimates has failed.
- (errno )
Failure whilst calculating backforecasts.
- (errno )
Satisfactory parameter estimates could not be obtained for all parameter types in the model.
- Notes
No equivalent traditional C interface for this routine exists in the NAG Library.
The time series supplied to the function is assumed to follow a seasonal autoregressive integrated moving average (ARIMA) model defined as follows:
where is the result of applying non-seasonal differencing of order and seasonal differencing of seasonality and order to the series , as outlined in the description of
uni_diff()
. The differenced series is then of length , where is the generalized order of differencing. The scalar is the expected value of the differenced series, and the series follows a zero-mean stationary autoregressive moving average (ARMA) model defined by a pair of recurrence equations. These express in terms of an uncorrelated series , via an intermediate series . The first equation describes the seasonal structure:The second equation describes the non-seasonal structure. If the model is purely non-seasonal the first equation is redundant and above is equated with :
Estimates of the model parameters defined by
and (optionally) are obtained by minimizing a quadratic form in the vector .
The minimization process is iterative, iterations being performed until convergence is achieved (see Notes for uni_arima_estim for full details), or until the user-specified maximum number of iterations are completed.
The final values of the residual sum of squares and the parameter estimates are used to obtain asymptotic approximations to the standard deviations of the parameters, and the correlation matrix for the parameters. The ‘state set’ array of information required by forecasting is also returned.
Note: if the maximum number of iterations are performed without convergence, these quantities may not be reliable. In this case, the sequence of iterates should be checked, using the optional monitoring function, to verify that convergence is adequate for practical purposes.
- References
Box, G E P and Jenkins, G M, 1976, Time Series Analysis: Forecasting and Control, (Revised Edition), Holden–Day
Marquardt, D W, 1963, An algorithm for least squares estimation of nonlinear parameters, J. Soc. Indust. Appl. Math. (11), 431