score_test_tnarpq_j {PNAR} | R Documentation |
Bootstrap test for threshold effects on PNAR(p) model
Description
Computation of bootstrap p-value for the sup-type test for testing linearity of
Poisson Network Autoregressive model of order (PNAR(
)) versus the
non-linear Threshold alternative (T-PNAR(
)).
Usage
score_test_tnarpq_j(supLM, b, y, W, p, d, Z = NULL, J = 499,
gama_L = NULL, gama_U = NULL, tol = 1e-9, ncores = 1, seed = NULL)
Arguments
supLM |
The optimized value of the test statistic. See the function
|
b |
The estimated parameters from the linear model, in the following order:
(intercept, network parameters, autoregressive parameters, covariates).
The dimension of the vector should be |
y |
A |
W |
The |
p |
The number of lags in the model. |
d |
The lag parameter of non-linear variable (should be between 1 and |
Z |
An |
J |
The number of bootstrap samples to draw. |
gama_L |
The lower value of the nuisance parameter |
gama_U |
The upper value of the nuisance parameter |
tol |
Tolerance level for the optimizer. |
ncores |
Number of cores to use for parallel computing. By default the number of cores is set to 1 (no parallel computing). Note: If for some reason the parallel does not work then load the doParallel package yourseleves. |
seed |
To replicate the results use a seed for the generator, an integer number. |
Details
The function computes a bootstrap p-value for the sup-type test for testing linearity of Poisson Network Autoregressive model of order (PNAR(
)) versus the following Threshold alternative (T-PNAR(
)). For each node of the network
over the time sample
where is the network effect, i.e. the weighted average impact of node
connections, with the weights of the mean being
, the single element of the network matrix
. The sequence
is the expectation of
, conditional to its past values.
The null hypothesis of the test is defined as , versus the alternative that at least one among
is not
, for
. The test statistic has the form
where
is the partition of the quasi score related to the vector of non-linear parameters , evaluated at the estimated parameters
under the null assumption
(linear model), and
is the variance of
.
Since the test statistic depends on an unknown nuisance parameter (), the supremum of the statistic is considered in the test,
. This value can be computed for the available sample by using the function
global_optimise_LM_tnarpq
and should be supplied here as an input supLM
.
The function performs the bootstrap resampling of the test statistic by employing Gaussian perturbations of the score
. For details see Armillotta and Fokianos (2022b, Sec. 5).
The values of gama_L
and gama_U
are computed internally as the mean over of
and
quantiles of the empirical distribution of the network mean
for
. In this way the optimization is performed for values of
such that the indicator function
is not always close to 0 or 1. Alternatively, their value can be supplied by the user. For details see Armillotta and Fokianos (2022b, Sec. 4-5).
Note: For large datasets the function may require few minutes to run. Parallel computing is suggested to speed up the computations.
Value
A list including:
pJ |
The bootstrap p-value of the sup test. |
cpJ |
The adjusted version of bootstrap p-value of the sup test. |
gamaj |
The optimal values of the |
supLMj |
The values of perturbed test statistic at the optimum point |
Author(s)
Mirko Armillotta, Michail Tsagris and Konstantinos Fokianos.
References
Armillotta, M. and K. Fokianos (2022a). Poisson network autoregression. https://arxiv.org/abs/2104.06296
Armillotta, M. and K. Fokianos (2022b). Testing linearity for network autoregressive models. https://arxiv.org/abs/2202.03852
Armillotta, M., Tsagris, M. and Fokianos, K. (2022c). The R-package PNAR for modelling count network time series. https://arxiv.org/abs/2211.02582
See Also
global_optimise_LM_tnarpq,
global_optimise_LM_stnarpq, score_test_stnarpq_j
Examples
# load data
data(crime)
data(crime_W)
#estimate linear PNAR model
mod1 <- lin_estimnarpq(crime, crime_W, p = 2)
b <- mod1$coefs[, 1]
g <- global_optimise_LM_tnarpq(b = b, y = crime, W = crime_W, p = 2, d = 1)
supg <- g$supLM
score_test_tnarpq_j(supLM = supg, b = b, y = crime, W = crime_W, p = 2, d = 1, J = 5)