Performs a parametric bootstrap likelihood-ratio test on the spatial scale parameter using the compactly supported GenWend correlation model.
Two hypotheses are compared: H0 imposes a maximum admissible scale (or independence), while H1 estimates scale freely.
The test statistic is the likelihood ratio and the p-value is obtained by parametric bootstrap under H0.
GeoTestsupp_space(data, coordx,
start, fixed,
model = "Gaussian",
h0 = NULL,
optimizer = "bobyqa",
lower = NULL, upper = NULL,
neighb = 5,
B = 1000,
likelihood = NULL,
type = NULL,
method = c("cholesky", "TB"),
L = 1000,
parallel = TRUE,
ncores = NULL,
progress = TRUE,
seed = NULL)An invisible list with components:
Minimum inter-point distance \(d_{min}\).
Threshold actually used under H0.
Observed likelihood-ratio statistic \(\Lambda_{obs}\).
Bootstrap p-value.
Vector of bootstrap statistics \(\Lambda_b\) for valid replications.
GeoFit object fitted under H0.
GeoFit object fitted under H1.
Seed supplied by the user, or NULL.
Numeric vector of observations of length n.
n x d matrix with spatial coordinates.
Named list of parameters to be estimated. Names must match the required correlation and nuisance parameters not supplied in fixed.
Named list of parameters kept fixed. Together with start, it must exactly cover the required set of correlation and nuisance parameters.
Marginal model for the data. Default is "Gaussian".
Positive threshold for the scale parameter under H0. If NULL, H0 represents spatial independence with scale = h0_val set to the adjusted minimum inter-point distance.
Optimization method passed to GeoFit, for example "bobyqa".
Named lists with bounds for parameters in start only. NULL means no extra bounds beyond the internal defaults. Bounds are internally widened if too narrow.
Number of neighbors for composite likelihood when applicable. Ignored when the full likelihood is used.
Number of parametric bootstrap replications. Default is 1000.
Type of likelihood to pass to GeoFit, for example "Marginal". Either specify both likelihood and type, or leave both NULL for automatic selection.
Likelihood type to pass to GeoFit, for example "Pairwise". Either specify both likelihood and type, or leave both NULL for automatic selection.
Simulation method for bootstrap samples under H0. Use "cholesky" for GeoSim or "TB" for turning-bands simulation through GeoSimapprox.
Number of spectral components used by GeoSimapprox when method = "TB". Default is 1000. Ignored when method = "cholesky".
If TRUE, parallel computation is used when available. For method = "TB", GeoSimapprox may parallelize the simulation of the B bootstrap datasets; the subsequent bootstrap fits may also be parallelized in a separate phase.
Number of cores for parallelization. If NULL, it is selected automatically up to B or parallel::detectCores()-1.
If TRUE, progress bars are shown via progressr.
Optional integer seed used to initialize the random number generator before the parametric bootstrap simulation. If NULL, the current random state is left unchanged. When supplied, the previous .Random.seed is restored on exit.
Moreno Bevilacqua moreno.bevilacqua89@gmail.com https://sites.google.com/view/moreno-bevilacqua/home
Víctor Morales Oñate victor.morales@uv.cl https://sites.google.com/site/moralesonatevictor/
Christian Caamaño-Carrillo chcaaman@ubiobio.cl https://www.researchgate.net/profile/Christian-Caamano
The function fixes the correlation model to corrmodel = "GenWend", a compactly supported generalized Wendland model.
Input validation checks consistency of parameter names between start and fixed with respect to CorrParam("GenWend") and NuisParam(model).
Reproducibility.
If seed is supplied, set.seed(seed) is called before simulation/bootstrap operations. The user's previous random-number-generator state is restored when the function exits, so setting seed makes the test reproducible without permanently changing the global RNG state.
Likelihood selection.
If both likelihood and type are NULL, the function selects likelihood = "Marginal", type = "Pairwise" for large datasets and likelihood = "Full", type = "Standard" otherwise. If only one of likelihood or type is supplied, an error is raised.
Threshold h0 and minimum distance.
Let \(d_{min}\) be the minimum inter-point distance, computed with nabor. If h0 = NULL, the test defaults to an independence test with h0_val = max(1e-6, d_min - 1e-6).
Under H0, the support parameter is constrained by scale <= h0, or fixed to h0_val in the independence case. Under H1, the scale is estimated freely, with a large data-driven upper bound.
Likelihood-ratio statistic.
Let \(\Lambda_{obs} = \max\{0, 2(\ell_1 - \ell_0)\}\), where \(\ell_0\) and \(\ell_1\) are the log-likelihood or log-composite-likelihood values under H0 and H1. The null distribution of \(\Lambda\) is approximated by parametric bootstrap with B datasets simulated under H0. The p-value is computed as
$$(1 + \#\{\Lambda_b \ge \Lambda_{obs}\}) / (1 + B_{valid}).$$
Simulation.
For method = "cholesky", bootstrap datasets are simulated with GeoSim. For method = "TB", they are simulated with GeoSimapprox, using L spectral components. When parallel = TRUE, GeoSimapprox may parallelize over the B independent bootstrap replications. The function saves and restores the user's future plan and progressr handlers.
Early exit.
If the unconstrained fit under H1 already satisfies scale <= h0 or scale <= h0_val, the function returns lambda_obs = 0 and pvalue = 1 without running the bootstrap.
Robust bounds.
The helper routines widen degenerate or ultra-narrow parameter boxes and enforce positivity for sill and scale where needed.
GeoFit, GeoSim, GeoSimapprox, GeoVarest