Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

AR1EIM

Computation of the Exact EIM of an Order-1 Autoregressive Process


Description

Computation of the exact Expected Information Matrix of the Autoregressive process of order-1 (AR(1)) with Gaussian white noise and stationary random components.

Usage

AR1EIM(x = NULL, var.arg = NULL, p.drift = NULL,
       WNsd = NULL, ARcoeff1 = NULL, eps.porat = 1e-2)

Arguments

x

A vector of quantiles. The gaussian time series for which the EIMs are computed.

If multiple time series are being analyzed, then x must be a matrix where each column allocates a response. That is, the number of columns (denoted as NOS) must match the number of responses.

var.arg

Logical. Same as with AR1.

p.drift

A numeric vector with the scaled mean(s) (commonly referred as drift) of the AR process(es) in turn. Its length matches the number of responses.

WNsd, ARcoeff1

Matrices. The standard deviation of the white noise, and the correlation (coefficient) of the AR(1) model, for each observation.

That is, the dimension for each matrix is N x NOS, where N is the number of observations and NOS is the number of responses. Else, these arguments are recycled.

eps.porat

A very small positive number to test whether the standar deviation (WNsd) is close enough to its value estimated in this function.

See below for further details.

Details

This function implements the algorithm of Porat and Friedlander (1986) to recursively compute the exact expected information matrix (EIM) of Gaussian time series with stationary random components.

By default, when the VGLM/VGAM family function AR1 is used to fit an AR(1) model via vglm, Fisher scoring is executed using the approximate EIM for the AR process. However, this model can also be fitted using the exact EIMs computed by AR1EIM.

Given N consecutive data points, {y[0], y[1], …, y[N - 1]} with probability density f(y), the Porat and Friedlander algorithm calculates the EIMs J(n-1)[θ], for all 1 ≤ n ≤ N. This is done based on the Levinson-Durbin algorithm for computing the orthogonal polynomials of a Toeplitz matrix. In particular, for the AR(1) model, the vector of parameters to be estimated under the VGAM/VGLM approach is

η = ( mu^*, log(sigma^2), rhobit(rho)),

where sigma^2 is the variance of the white noise and mu^* is the drift parameter (See AR1 for further details on this).

Consequently, for each observation n = 1, …, N, the EIM, Jn[θ], has dimension 3 x 3, where the diagonal elements are:

J[n, 1, 1] = E[ -δ^2 log f(y) / δ (mu^*)^2 ],

J[n, 2, 2] = E[ - δ^2 log f(y) / δ (σ^2)^2 ],

and

J[n, 3, 3] = E[ -δ^2 log f(y) / δ (rho)^2].

As for the off-diagonal elements, one has the usual entries, i.e.,

J[n, 1, 2] = J[n, 2, 1] = E[ -δ^2 log f(y) / δ σ^2 δ rho ],

etc.

If var.arg = FALSE, then σ instead of σ^2 is estimated. Therefore, J[n, 2, 2], J[n, 1, 2], etc., are correspondingly replaced.

Once these expected values are internally computed, they are returned in an array of dimension N x 1 x 6, of the form

J[, 1, ] = [ J[ , 1, 1], J[ , 2, 2], J[ , 3, 3], J[ , 1, 2], J[ , 2, 3], J[ , 1, 3] ].

AR1EIM handles multiple time series, say NOS. If this happens, then it accordingly returns an array of dimension N x NOS x 6. Here, J[, k, ], for k = 1, …, NOS, is a matrix of dimension N x 6, which stores the EIMs for the kth response, as above, i.e.,

J[, k, ] = [ J[ , 1, 1], J[ , 2, 2], J[ , 3, 3], … ],

the bandwith form, as per required by AR1.

Value

An array of dimension N x NOS x 6, as above.

This array stores the EIMs calculated from the joint density as a function of

θ = (mu^*, sigma^2, rho).

Nevertheless, note that, under the VGAM/VGLM approach, the EIMs must be correspondingly calculated in terms of the linear predictors, η.

Asymptotic behaviour of the algorithm

For large enough n, the EIMs, Jn(θ), become approximately linear in n. That is, for some n0,

Jn(θ) -> Jn0(θ) + (n - n0) * Jbar(θ), (*)

where Jbar(θ) is a constant matrix.

This relationsihip is internally considered if a proper value of n0 is determined. Different ways can be adopted to find n0. In AR1EIM, this is done by checking the difference between the internally estimated variances and the entered ones at WNsd. If this difference is less than eps.porat at some iteration, say at iteration n0, then AR1EIM takes Jbar(θ) as the last computed increment of Jn(θ), and extraplotates Jk(θ), for all k ≥ n0 using (*). Else, the algorithm will complete the iterations for 1 ≤ n ≤ N.

Finally, note that the rate of convergence reasonably decreases if the asymptotic relationship (*) is used to compute Jk(θ), k ≥ n0. Normally, the number of operations involved on this algorithm is proportional to N^2.

See Porat and Friedlander (1986) for full details on the asymptotic behaviour of the algorithm.

Warning

Arguments WNsd, and ARcoeff1 are matrices of dimension N x NOS. Else, these arguments are accordingly recycled.

Note

For simplicity, one can assume that the time series analyzed has a 0-mean. Consequently, where the family function AR1 calls AR1EIM to compute the EIMs, the argument p.drift is internally set to zero-vector, whereas x is centered by subtracting its mean value.

Author(s)

V. Miranda and T. W. Yee.

References

Porat, B. and Friedlander, B. (1986). Computation of the Exact Information Matrix of Gaussian Time Series with Stationary Random Components. IEEE Transactions on Acoustics, Speech, and Signal Processing, 54(1), 118–130.

See Also

AR1.

Examples

set.seed(1)
  nn <- 500
  ARcoeff1 <- c(0.3, 0.25)        # Will be recycled.
  WNsd     <- c(exp(1), exp(1.5)) # Will be recycled.
  p.drift  <- c(0, 0)             # Zero-mean gaussian time series.

  ### Generate two (zero-mean) AR(1) processes ###
  ts1 <- p.drift[1]/(1 - ARcoeff1[1]) +
                   arima.sim(model = list(ar = ARcoeff1[1]), n = nn,
                   sd = WNsd[1])
  ts2 <- p.drift[2]/(1 - ARcoeff1[2]) +
                   arima.sim(model = list(ar = ARcoeff1[2]), n = nn,
                   sd = WNsd[2])

  ARdata <- matrix(cbind(ts1, ts2), ncol = 2)


  ### Compute the exact EIMs: TWO responses. ###
  ExactEIM <- AR1EIM(x = ARdata, var.arg = FALSE, p.drift = p.drift,
                           WNsd = WNsd, ARcoeff1 = ARcoeff1)

  ### For response 1:
  head(ExactEIM[, 1 ,])      # NOTICE THAT THIS IS A (nn x 6) MATRIX!

  ### For response 2:
  head(ExactEIM[, 2 ,])      # NOTICE THAT THIS IS A (nn x 6) MATRIX!

VGAM

Vector Generalized Linear and Additive Models

v1.1-5
GPL-3
Authors
Thomas Yee [aut, cre], Cleve Moler [ctb] (author of several LINPACK routines)
Initial release
2021-01-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.