naginterfaces.library.tsa.multi_varma_estimate¶
- naginterfaces.library.tsa.multi_varma_estimate(ip, iq, mean, par, qq, w, parhld, exact, iprint, cgetol, ishow, maxcal=None, io_manager=None)[source]¶
multi_varma_estimate
fits a vector autoregressive moving average (VARMA) model to an observed vector of time series using the method of Maximum Likelihood (ML). Standard errors of parameter estimates are computed along with their appropriate correlation matrix. The function also calculates estimates of the residual series.For full information please refer to the NAG Library document for g13dd
https://www.nag.com/numeric/nl/nagdoc_29/flhtml/g13/g13ddf.html
- Parameters
- ipint
, the number of AR parameter matrices.
- iqint
, the number of MA parameter matrices.
- meanbool
, if components of have been estimated and , if all elements of are to be taken as zero.
- parfloat, array-like, shape
Initial parameter estimates read in row by row in the order , .
Thus,
if , must be set equal to an initial estimate of the th element of , for , for , for ;
if , must be set equal to an initial estimate of the th element of , and ;
if , should be set equal to an initial estimate of the th component of (). (If you set to then
multi_varma_estimate
will calculate the mean of the th series and use this as an initial estimate of .)The first elements of must satisfy the stationarity condition and the next elements of must satisfy the invertibility condition.
If in doubt set all elements of to .
- qqfloat, array-like, shape
must be set equal to an initial estimate of the th element of . The lower triangle only is needed. must be positive definite. It is strongly recommended that on entry the elements of are of the same order of magnitude as at the solution point. If you set , for , for , then
multi_varma_estimate
will calculate the covariance matrix between the time series and use this as an initial estimate of .- wfloat, array-like, shape
must be set equal to the th component of , for , for .
- parhldbool, array-like, shape
must be set to if is to be held constant at its input value and if is a free parameter, for .
If in doubt try setting all elements of to .
- exactbool
Must be set equal to if you wish
multi_varma_estimate
to compute exact maximum likelihood estimates. must be set equal to if only conditional likelihood estimates are required.- iprintint
The frequency with which the automatic monitoring function is to be called.
The ML search procedure is monitored once every iterations and just before exit from the search function.
The search function is monitored once at the final point.
The search function is not monitored at all.
- cgetolfloat
The accuracy to which the solution in and is required.
If is set to and on exit no exception or warning is raised or >= 6, then all the elements in and should be accurate to approximately decimal places.
For most practical purposes the value should suffice.
You should be wary of setting too small since the convergence criteria may then have become too strict for the machine to handle.
If has been set to a value which is less than the machine precision, , then
multi_varma_estimate
will use the value instead.- ishowint
Specifies which of the following two quantities are to be printed.
table of maximum likelihood estimates and their standard errors (as returned in the output arrays , and );
table of residual series (as returned in the output array ).
None of the above are printed.
(i) only is printed.
(i) and (ii) are printed.
- maxcalNone or int, optional
Note: if this argument is None then a default value will be used, determined as follows: .
The maximum number of likelihood evaluations to be permitted by the search procedure.
- io_managerFileObjManager, optional
Manager for I/O in this routine.
- Returns
- parfloat, ndarray, shape
If no exception or warning is raised or >= 4 then all the elements of will be overwritten by the latest estimates of the corresponding ARMA parameters.
- qqfloat, ndarray, shape
If no exception or warning is raised or >= 4 then will contain the latest estimate of the th element of . The lower triangle only is returned.
- niterint
If no exception or warning is raised or >= 4 then contains the number of iterations performed by the search function.
- rloglfloat
If no exception or warning is raised or >= 4 then contains the value of the log-likelihood function corresponding to the final point held in and .
- vfloat, ndarray, shape
If no exception or warning is raised or >= 4 then will contain an estimate of the th component of , for , for , corresponding to the final point held in and .
- gfloat, ndarray, shape
If no exception or warning is raised or >= 4 then will contain the estimated first derivative of the log-likelihood function with respect to the th element in the array . If the gradient cannot be computed then all the elements of are returned as zero.
- cmfloat, ndarray, shape
If no exception or warning is raised or >= 4 then will contain an estimate of the correlation coefficient between the th and th elements in the array for , . If , then will contain the estimated standard error of . If the th component of has been held constant, i.e., was set to , then the th row and column of will be set to zero. If the second derivative matrix cannot be computed then all the elements of are returned as zero.
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, , and .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, and .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
The initial estimate of is not positive definite.
- (errno )
The initial AR parameter estimates are outside the stationarity region.
- (errno )
The initial MA parameter estimates are outside the invertibility region.
- (errno )
The starting point is too close to the boundary of the admissibility region.
- (errno )
The function cannot compute a sufficiently accurate estimate of the gradient vector at the user-supplied starting point.
- (errno )
There have been log-likelihood evaluations made in the function.
See the function document for further details.
- Warns
- NagAlgorithmicWarning
- (errno )
The conditions for a solution have not all been met, but a point at which the log-likelihood took a larger value could not be found.
See the function document for further details.
- (errno )
The ML solution is so close to the boundary of either the stationarity region or the invertibility region that
multi_varma_estimate
cannot evaluate the Hessian matrix. The elements of are set to zero, as are the elements of . All other output quantities are correct.- (errno )
An estimate of the second derivative matrix and the gradient vector at the solution point was computed. Either the Hessian matrix was found to be too ill-conditioned to be evaluated accurately or the gradient vector could not be computed to an acceptable degree of accuracy. The elements of are set to zero, as are the elements of . All other output quantities are correct.
- (errno )
The second-derivative matrix at the solution point is not positive definite. The elements of are set to zero. All other output quantities are correct.
- Notes
Let , for , denote a vector of time series which is assumed to follow a multivariate ARMA model of the form
where , for , is a vector of residual series assumed to be Normally distributed with zero mean and positive definite covariance matrix . The components of are assumed to be uncorrelated at non-simultaneous lags. The and are matrices of parameters. , for , are called the autoregressive (AR) parameter matrices, and , for , the moving average (MA) parameter matrices. The parameters in the model are thus the () -matrices, the () -matrices, the mean vector, , and the residual error covariance matrix . Let
where denotes the identity matrix.
The ARMA model (1) is said to be stationary if the eigenvalues of lie inside the unit circle. Similarly, the ARMA model (1) is said to be invertible if the eigenvalues of lie inside the unit circle.
The method of computing the exact likelihood function (using a Kalman filter algorithm) is discussed in Shea (1987). A quasi-Newton algorithm (see Gill and Murray (1972)) is then used to search for the maximum of the log-likelihood function. Stationarity and invertibility are enforced on the model using the reparameterisation discussed in Ansley and Kohn (1986). Conditional on the maximum likelihood estimates being equal to their true values the estimates of the residual series are uncorrelated with zero mean and constant variance .
You have the option of setting an argument ( to ) so that
multi_varma_estimate
calculates conditional maximum likelihood estimates (conditional on ). This may be useful if the exact maximum likelihood estimates are close to the boundary of the invertibility region.You also have the option (see Parameters) of requesting
multi_varma_estimate
to constrain elements of the and matrices and vector to have pre-specified values.
- References
Ansley, C F and Kohn, R, 1986, A note on reparameterising a vector autoregressive moving average model to enforce stationarity, J. Statist. Comput. Simulation (24), 99–106
Gill, P E and Murray, W, 1972, Quasi-Newton methods for unconstrained optimization, J. Inst. Math. Appl. (9), 91–108
Shea, B L, 1987, Estimation of multivariate time series, J. Time Ser. Anal. (8), 95–110