critical.value: Critical Values for Autocorrelation Robust Testing

Description Usage Arguments Details Value References See Also Examples

View source: R/critical.value.R

Description

This function provides an implementation of Algorithm 1 in Pötscher and Preinerstorfer (2016), which we here abbreviate as (A1). The user is referred to this article for definitions, a detailed description of the problem solved by (A1), and for a detailed description of the algorithm itself.

Usage

1
2
3
4
5
6
7
critical.value(alpha, ar.order.max, bandwidth, ker, R, X, N0, N1, N2, Mp, M1, 
               M2, Eicker = FALSE, 
               opt.method.1 = "Nelder-Mead",
               opt.method.2 = "Nelder-Mead", 
               control.1 = list("reltol" = N1^(-.5), "maxit" = dim(X)[1]*20),
               control.2 = list("reltol" = N2^(-.5), "maxit" = dim(X)[1]*30),   
               cores = 1, margin = rep(1, length = ar.order.max))

Arguments

alpha

Significance level. A real number in the interval (0, 1).

ar.order.max

Maximal order of the stationary autoregressive error process. A nonnegative integer. If ar.order.max is greater than sample size minus one, then ar.order.max is automatically replaced by sample size minus one. If ar.order.max equals sample size minus one, then the critical value approximated by (A1) controls size over the set of all stationary Gaussian error processes. If ar.order.max is set equal to 0, critical.value does not return the outcome of (A1), because no optimization is needed in that case. Instead, it draws a pseudorandom sample of size N2 from the distribution of the test statistic under the null hypothesis and returns the corresponding 1-α quantile.

bandwidth

Bandwidth parameter used in the construction of the test statistic. A positive real number.

ker

Kernel function used in the construction of the test statistic. ker can take one of the values "Bartlett", "Parzen", or "Quadratic Spectral". The kweights function is used to generate the weights. For the test statistic T_{w} this implies the weights used via w(j, n) = ker(j/bandwidth). For the test statistic T_{E, \mathsf{W}} this implies the weights matrix \mathsf{W} via \mathsf{W}_{ij} = ker((i-j)/bandwidth), cf. Pötscher and Preinerstorfer (2016) for definitions of T_{w} and T_{E, \mathsf{W}}.

R

The restriction matrix. critical.value returns a critical value for the hypothesis R β = r. R needs to be of full row rank, and needs to have the same number of columns as X.

X

The design matrix. X needs to be of full column rank. The number of columns of X must be smaller than the number of rows of X.

N0

A positive integer. Corresponds to N_0 in the description of (A1) in Pötscher and Preinerstorfer (2016).

N1

A positive integer. Corresponds to N_1 in the description of (A1) in Pötscher and Preinerstorfer (2016). N1 should be greater than N0.

N2

A positive integer. Corresponds to N_2 in the description of (A1) in Pötscher and Preinerstorfer (2016). N2 should be greater than N1.

Mp

A positive integer. Mp determines M_0 in (A1), i.e., the number of starting values chosen in Stage 0 of (A1). The way initial values are generated depends on ar.order.max:

  1. If ar.order.max is 0 the choice of Mp is irrelevant, see the description of ar.order.max above.

  2. If ar.order.max is either 1 or 2, then the initial values are an i.i.d. pseudorandom sample of size Mp drawn from a distribution on the set of partial autocorrelation coefficients that induces a uniform distribution on the set of stationary autoregressive coefficients of order ar.order.max (cf. Jones (1987)).

  3. If ar.order.max is greater than 2, then starting values are generated as follows: Let A denote the set of integer multiples of 5 that are greater than 2 and smaller than ar.order.max. For every number

    l \in A \cup \{2, ar.order.max\}

    the algorithm in Jones (1987) is used to generate a pseudorandom sample of size Mp on the set of partial autocorrelation coefficients from a distribution that induces a uniform distribution on the set of stationary AR(l) coefficients. These samples are then used as initial values, cf. also the discussion in Pötscher and Preinerstorfer (2016).

M1

A positive integer. Corresponds to M_1 in the description of (A1) in Pötscher and Preinerstorfer (2016). M1 must not exceed Mp.

M2

A positive integer. Corresponds to M_2 in the description of (A1) in Pötscher and Preinerstorfer (2016). M2 must not exceed M1.

Eicker

Determines the test statistic used. If Eicker = TRUE, then critical values for T_{E, \mathsf{W}} (with \mathsf{W}_{ij}=ker((i-j)/bandwidth)) are computed. If Eicker = FALSE, then critical values for T_{w} (with w(j, n) = ker(j/bandwidth)) are computed (cf. Pötscher and Preinerstorfer (2016) for a precise definition of these test statistics). Default is Eicker = FALSE.

opt.method.1

The optimization method chosen in Stage 1 of (A1). Any optimization routine implemented in optim apart from "Brent" can be supplied. The default is "Nelder-Mead".

opt.method.2

The optimization method chosen in Stage 2 of (A1). Any optimization routine implemented in optim apart from "Brent" can be supplied. The default is "Nelder-Mead".

control.1

Control parameters passed to the optim function in Stage 1 of (A1). Default is control.1 = list("reltol" = N1^(-.5), "maxit" = dim(X)[1]*20).

control.2

Control parameters passed to the optim function in Stage 2 of (A1). Default is control.2 = list("reltol" = N2^(-.5), "maxit" = dim(X)[1]*30).

cores

The number of CPU cores used in the (parallelized) computation of the Monte-Carlo approximations in (A1). Default is 1. Parallelized computation is enabled only if the compiler used to build acrt supports OpenMP.

margin

The restrictions imposed on the partial autocorrelation coefficients. margin is an ar.order.max-dimensional vector of real numbers in (0, 1]. Default is margin = rep(1, length = ar.order.max), which corresponds to no restriction.

Details

For details see the relevant sections in Pötscher and Preinerstorfer (2016), in particular the description of Algorithm 1 in the Appendix.

Value

The output of critical.value depends on ar.order.max. If ar.order.max is zero, the function critical.value returns a list consisting of:

critical.value

The critical value obtained by drawing a pseudorandom sample of size N2 from the distribution of the test statistic under the null hypothesis and by computing the corresponding 1-α quantile.

If ar.order.max is greater than zero, the function critical.value returns a list consisting of:

starting.parameters

The rows of this matrix are the initial values (partial autocorrelation coefficient vectors) that were used in Stage 1 of (A1), and which were chosen from the pool of randomly generated initial values in Stage 0. The rows correspond to ρ_{1:M_0}, ..., ρ_{M_1:M_0}, respectively, in the description of (A1).

starting.quantiles

Monte Carlo approximations of the 1-α quantiles corresponding to the initial values used in Stage 1 of (A1). The coordinates of this vector correspond to \tilde{F}^{-1}_{1:M_0}(1-α), ..., \tilde{F}^{-1}_{M_1:M_0}(1-α) in the description of (A1).

first.stage.parameters

The rows of this matrix are the parameters (partial autocorrelation coefficients) that were obtained in Stage 1 of (A1). The rows correspond to ρ^*_{1}, ..., ρ^*_{M_1}, respectively, in the description of (A1).

first.stage.quantiles

Monte Carlo approximations of the 1-α quantiles corresponding to the
first.stage.parameters, i.e., \bar{F}_{j, ρ_j^*}^{-1}(1-α) for j = 1, ..., M_1 in the description of (A1).

second.stage.parameters

The rows of this matrix are the parameters (partial autocorrelation coefficients) that were obtained in Stage 2 of (A1). The rows correspond to ρ^{**}_{1}, ..., ρ^{**}_{M_2}, respectively, in the description of (A1).

second.stage.quantiles

Monte Carlo approximations of the 1-α quantiles corresponding to the
second.stage.parameters, i.e., \bar{\bar{F}}_{j, ρ_j^{**}}^{-1}(1-α) for j = 1, ..., M_2 in the description of (A1).

convergence

Convergence codes returned from optim in Stage 2 of (A1) for each initial value.

critical.value

The critical value obtained by (A1), i.e., the maximum of \bar{\bar{F}}_{j, ρ_j^{**}}^{-1}(1-α) for j = 1, ..., M_2.

References

Jones, M. C. (1987). Randomly choosing parameters from the stationarity and invertibility region of autoregressive-moving average models. Applied Statistics, 36 134-138.

Pötscher, B.M. and Preinerstorfer, D. (2016). Controlling the size of autocorrelation robust tests. https://arxiv.org/abs/1612.06127/

See Also

optim, kweights.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
n <- 100
alpha <- .05
ar.order.max <- n-1
bandwidth <- 10
ker <- "Bartlett"
R <- matrix(c(0, 1), nrow = 1, ncol = 2)
X <- cbind(rep(1, length = n), rnorm(n))
N0 <- 1000
N1 <- 10000
N2 <- 50000
Mp <- 5000
M1 <- 10
M2 <- 2

critical.value(alpha, ar.order.max, bandwidth, ker, R, X, N0, N1, N2, Mp, M1, 
               M2)

## End(Not run)

acrt documentation built on May 2, 2019, 1:27 p.m.