Description Usage Arguments Details Value References See Also Examples
This function provides an implementation of Algorithm 2 in Pötscher and Preinerstorfer (2016), which we here abbreviate as (A2). The user is referred to this article for definitions, a detailed description of the problem solved by (A2), and for a detailed description of the algorithm itself.
1 2 3 4 5 6 7 | size(C, 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))
|
C |
Critical value. A positive real number (for negative critical values the size of the test equals 1). |
ar.order.max |
Maximal order of the stationary autoregressive
error process. A nonnegative integer.
If |
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.
|
R |
The restriction matrix. |
X |
The design matrix. |
N0 |
A positive integer. Corresponds to N_0 in the description of (A2) in Pötscher and Preinerstorfer (2016). |
N1 |
A positive integer. Corresponds to N_1 in the description of (A2) in Pötscher and Preinerstorfer (2016). N1 should be greater than N0. |
N2 |
A positive integer. Corresponds to N_2 in the description of (A2) in Pötscher and Preinerstorfer (2016). N2 should be greater than N1. |
Mp |
A positive integer.
|
M1 |
A positive integer. Corresponds to M_1 in the description of (A2) in Pötscher and Preinerstorfer (2016). M1 must not exceed Mp. |
M2 |
A positive integer. Corresponds to M_2 in the description of (A2) in Pötscher and Preinerstorfer (2016). M2 must not exceed M1. |
Eicker |
Determines the test for which the size is computed. If
|
opt.method.1 |
The optimization method chosen in Stage 1
of (A2). Any optimization routine implemented in |
opt.method.2 |
The optimization method chosen in Stage 2
of (A2). Any optimization routine implemented in |
control.1 |
Control parameters passed to the |
control.2 |
Control parameters passed to the |
cores |
The number of CPU cores used in the (parallelized) computation of the Monte-Carlo approximations in (A2). 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. |
For details see the relevant sections in Pötscher and Preinerstorfer (2016), in particular the description of Algorithm 2 in the Appendix.
The output of size
depends on ar.order.max
. If
ar.order.max
is zero, the function size
returns a list consisting of:
size |
The size obtained by drawing a pseudorandom sample of size |
If ar.order.max
is greater than zero, the function size
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 (A2), 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 (A2). |
starting.rejection.probs |
Monte Carlo approximations of the null-rejection probabilities corresponding to the initial values used in Stage 1 of (A2). The coordinates of this vector correspond to \tilde{p}_{1:M_0}, ..., \tilde{p}_{M_1:M_0} in the description of (A2). |
first.stage.parameters |
The rows of this matrix are the parameters (partial autocorrelation coefficients) that were obtained in Stage 1 of (A2). The rows correspond to ρ^*_{1}, ..., ρ^*_{M_1}, respectively, in the description of (A2). |
first.stage.rejection.probs |
Monte Carlo approximations of the
null-rejection
probabilities corresponding to the |
second.stage.parameters |
The rows of this matrix are the parameters (partial autocorrelation coefficients) that were obtained in Stage 2 of (A2). The rows correspond to ρ^{**}_{1}, ..., ρ^{**}_{M_2}, respectively, in the description of (A2). |
second.stage.rejection.probs |
Monte Carlo approximations of the null
rejection probabilities
corresponding to the |
convergence |
Convergence codes returned from |
size |
The size computed by (A2), i.e., the maximum of \bar{\bar{p}}_{j, ρ_j^{**}} for j = 1, ..., M_2. |
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/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
n <- 100
C <- 2.260568^2
ar.order.max <- n-1
bandwidth <- n/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
size(C, ar.order.max, bandwidth, ker, R, X, N0, N1, N2, Mp, M1, M2)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.