Learn R Programming

GeoModels (version 2.2.6)

GeoTestsupp_space: Parametric bootstrap test for spatial support (scale)

Description

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.

Usage

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)

Value

An invisible list with components:

d_min

Minimum inter-point distance \(d_{min}\).

h0

Threshold actually used under H0.

lambda_obs

Observed likelihood-ratio statistic \(\Lambda_{obs}\).

pvalue

Bootstrap p-value.

B_rep

Vector of bootstrap statistics \(\Lambda_b\) for valid replications.

fit_H0

GeoFit object fitted under H0.

fit_H1

GeoFit object fitted under H1.

seed

Seed supplied by the user, or NULL.

Arguments

data

Numeric vector of observations of length n.

coordx

n x d matrix with spatial coordinates.

start

Named list of parameters to be estimated. Names must match the required correlation and nuisance parameters not supplied in fixed.

fixed

Named list of parameters kept fixed. Together with start, it must exactly cover the required set of correlation and nuisance parameters.

model

Marginal model for the data. Default is "Gaussian".

h0

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.

optimizer

Optimization method passed to GeoFit, for example "bobyqa".

lower, upper

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.

neighb

Number of neighbors for composite likelihood when applicable. Ignored when the full likelihood is used.

B

Number of parametric bootstrap replications. Default is 1000.

likelihood

Type of likelihood to pass to GeoFit, for example "Marginal". Either specify both likelihood and type, or leave both NULL for automatic selection.

type

Likelihood type to pass to GeoFit, for example "Pairwise". Either specify both likelihood and type, or leave both NULL for automatic selection.

method

Simulation method for bootstrap samples under H0. Use "cholesky" for GeoSim or "TB" for turning-bands simulation through GeoSimapprox.

L

Number of spectral components used by GeoSimapprox when method = "TB". Default is 1000. Ignored when method = "cholesky".

parallel

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.

ncores

Number of cores for parallelization. If NULL, it is selected automatically up to B or parallel::detectCores()-1.

progress

If TRUE, progress bars are shown via progressr.

seed

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.

Details

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.

See Also

GeoFit, GeoSim, GeoSimapprox, GeoVarest