public static void g05pj( mode, n, k,  xmean, ip,  phi, iq,  theta, [,] var,  r, G05..::.G05State g05state, [,] x, out ifail )
|Visual Basic (Declaration)|
Public Shared Sub g05pj ( _ mode As , _ n As , _ k As , _ xmean As (), _ ip As , _ phi As (), _ iq As , _ theta As (), _ var As (,), _ r As (), _ g05state As G05..::.G05State, _ x As (,), _ < > ByRef ifail As _ )
public: static void g05pj( mode, n, k, array< >^ xmean, ip, array< >^ phi, iq, array< >^ theta, array< ,2>^ var, array< >^ r, G05..::.G05State^ g05state, array< ,2>^ x, [ ] % ifail )
static member g05pj : mode: * n: * k: * xmean:  * ip: * phi:  * iq: * theta:  * var: [,] * r:  * g05state:G05..::.G05State * x: [,] * ifail: byref -> unit
On entry: a code for selecting the operation to be performed by the method.
Constraint: , , or .
- Set up reference vector and compute a realization of the recent history.
- Generate terms in the time series using reference vector set up in a prior call to g05pj.
- Combine the operations of and .
- A new realization of the recent history is computed using information stored in the reference vector, and the following sequence of time series values are generated.
On entry: , the number of observations to be generated.Constraint: .
On entry: , the dimension of the multivariate time series.Constraint: .
- Type: array<
>()An array of size [k]On entry: , the vector of means of the multivariate time series.
On entry: , the number of autoregressive parameter matrices.Constraint: .
- Type: array<
>()An array of size On entry: must contain the elements of the autoregressive parameter matrices of the model, . If phi is considered as a three-dimensional array, dimensioned as , then the th element of would be stored in ; that is, must be set equal to the th element of , for and .Constraint: the elements of phi must satisfy the stationarity condition.
On entry: , the number of moving average parameter matrices.Constraint: .
- Type: array<
>()An array of size On entry: must contain the elements of the moving average parameter matrices of the model, . If theta is considered as a three-dimensional array, dimensioned as theta(k,k,iq), then the th element of would be stored in ; that is, must be set equal to the th element of , for and .Constraint: the elements of theta must be within the invertibility region.
- Type: array<
,2>[,](,)[,]An array of size [ldvar, k]Note: ldvar must satisfy the constraint:On entry: must contain the ()th element of , for . Only the lower triangle is required.Constraint: the elements of var must be such that is positive semi-definite.
- Type: array<
>()An array of size [lr]Note: lr must satisfy the constraint:
Where and if , , or if , .On entry: if or , the array r as output from the previous call to g05pj must be input without any change.If or , the contents of r need not be set.On exit: information required for any subsequent calls to the method with or . See [Further Comments].
- if , ;
- if , .
- Type: array<
,2>[,](,)[,]An array of size [ldx, n]Note: ldx must satisfy the constraint:On exit: will contain a realization of the th component of , for and .
On exit: unless the method detects an error (see [Error Indicators and Warnings]).
Let the vector , denote a -dimensional time series which is assumed to follow a vector autoregressive moving average (VARMA) model of the form:
where denotes the by identity matrix.
The model (1) must be both stationary and invertible. The model is said to be stationary if the eigenvalues of lie inside the unit circle and invertible if the eigenvalues of lie inside the unit circle.
For the VARMA model (1) is recast into state space form and a realization of the state vector at time zero computed. For all other cases the method computes a realization of the pre-observed vectors , , from (1), see Shea (1988). This realization is then used to generate a sequence of successive time series observations. Note that special action is taken for pure MA models, that is for .
At your request a new realization of the time series may be generated more efficiently using the information in a reference vector created during a previous call to g05pj. See the description of the parameter mode in [Parameters] for details.
The method returns a realization of . On a successful exit, the recent history is updated and saved in the array r so that g05pj may be called again to generate a realization of etc. See the description of the parameter mode in [Parameters] for details.
Further computational details are given in Shea (1988). Note, however, that g05pj uses a spectral decomposition rather than a Cholesky factorization to generate the multivariate Normals. Although this method involves more multiplications than the Cholesky factorization method and is thus slightly slower it is more stable when faced with ill-conditioned covariance matrices. A method of assigning the AR and MA coefficient matrices so that the stationarity and invertibility conditions are satisfied is described in Barone (1987).
Barone P (1987) A method for generating independent realisations of a multivariate normal stationary and invertible ARMA process J. Time Ser. Anal. 8 125–130
Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface (ldvar, lr, ldx, lstate) In these cases, an error in another parameter has usually caused an incorrect value to be inferred.
The autoregressive parameter matrices, stored in phi, are such that the model is non-stationary.
On entry, the moving average parameter matrices, stored in theta, are such that the model is non-invertible.
The covariance matrix , stored in var, is not positive-definite.
On entry, g05state vector was not initialized or has been corrupted.
This is an unlikely exit brought about by an excessive number of iterations being needed by the NAG Library method used to evaluate the eigenvalues of or .
This is an unlikely exit brought about by an excessive number of iterations being needed by the NAG Library method used to evaluate the eigenvalues of the covariance matrix.
An excessive number of iterations were required by the NAG method used to evaluate the eigenvalues of the covariance matrix.
The reference vector cannot be computed because the AR parameters are too close to the boundary of the stationarity region.
An excessive number of iterations were required by the NAG method used to evaluate the eigenvalues stored in the reference vector.
The accuracy is limited by the matrix computations performed, and this is dependent on the condition of the parameter and covariance matrices.
Note that, in reference to , g05pj will permit moving average parameters on the boundary of the invertibility region.
The elements of r contain amongst other information details of the spectral decompositions which are used to generate future multivariate Normals. Note that these eigenvectors may not be unique on different machines. For example the eigenvectors corresponding to multiple eigenvalues may be permuted. Although an effort is made to ensure that the eigenvectors have the same sign on all machines, differences in the signs may theoretically still occur.
The following table gives some examples of the required size of the array r, specified by the parameter lr, for or , and for various values of and .
Note that g13dx may be used to check whether a VARMA model is stationary and invertible.
The time taken depends on the values of , and especially and .
This program generates two realizations, each of length , from the bivariate AR(1) model
The pseudorandom number generator is initialized by a call to the state constructor (for a repeatable sequence). Then, in the first call to g05pj, in order to set up the reference vector before generating the first realization. In the subsequent call and a new recent history is generated and used to generate the second realization.