Learn R Programming

GeoModels (version 2.2.6)

GeoTestIsotropy: Parametric bootstrap test for isotropy

Description

Performs an isotropy test based on parametric bootstrap by comparing an isotropic model (H0) with an anisotropic model (H1). A user-chosen spatial correlation model is fitted to spatial data, and the test statistic is a likelihood ratio between H1 (with anisotropy estimated) and H0 (anisotropy fixed at ratio = 1 and angle = 0). The p-value is computed via parametric bootstrap.

Usage

GeoTestIsotropy(data, coordx,
 start, fixed,
 optimizer = "bobyqa",
 model = "Gaussian",
 corrmodel = "Matern",
 lower = NULL, upper = NULL,
 B = 1000,
 likelihood = NULL,
 type = NULL,
 copula = NULL,
 neighb = 5,
 method = c("cholesky", "TB"),
 L = 1000,
 parallel = TRUE,
 ncores = NULL,
 progress = TRUE,
 seed = NULL)

Value

An (invisible) list with components:

statistic

Observed LRT statistic.

pvalue

Bootstrap p-value.

ratio_hat

Estimated anisotropy ratio (> 1 indicates stretching along the principal axis).

angle_hat

Estimated anisotropy angle (radians/degrees according to GeoFit convention).

corrmodel

Correlation model used.

model

Marginal model used.

fit_H0

GeoFit object fitted under H0.

fit_H1

GeoFit object fitted under H1.

B_rep

Vector of LRT values obtained on the valid bootstrap replications.

seed

Seed used for the bootstrap, or NULL if no seed was supplied.

Arguments

data

Numeric vector of observations (length n).

coordx

n x d matrix with the spatial coordinates of the sites (at least 2 columns for anisotropy analysis).

start

Named list with the parameters to be estimated; names must match those expected by CorrParam(corrmodel) and NuisParam(model).

fixed

Named list with the parameters kept fixed during estimation; together with start it must exactly cover the required set of parameters.

optimizer

Optimization algorithm to be used in GeoFit (e.g., "bobyqa").

model

Marginal model for the data (e.g., "Gaussian").

corrmodel

Spatial correlation model (e.g., "Matern").

lower, upper

Named lists with lower/upper bounds for parameters in start only. If NULL, no extra bounds beyond defaults.

B

Number of parametric bootstrap replications (default 1000).

method

Simulation method used for the parametric bootstrap when copula = NULL. Options are "cholesky" for exact Gaussian simulation via GeoSim and "TB" for approximate spectral turning-bands simulation via GeoSimapprox.

L

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

likelihood

Type of (composite) likelihood to pass to GeoFit (e.g., "Marginal").

type

Composite-likelihood type (e.g., "Pairwise").

copula

Copula object for simulation via GeoSimCopula; if NULL Gaussian simulation is used.

neighb

Number of neighbors for composite-likelihood estimation, where applicable.

parallel

If TRUE, parametric simulations with GeoSimapprox and bootstrap fits are allowed to use parallel execution through future. The two phases are run sequentially, with the previous future plan restored between them.

ncores

Number of cores to use in parallel; if NULL it is chosen automatically up to B or parallel::detectCores()-1.

progress

If TRUE, show progress bars using progressr.

seed

Optional integer seed used to make the parametric bootstrap reproducible. If NULL, the current random-number generator state is left unchanged. When supplied, the function temporarily sets the seed and restores the user's original .Random.seed on exit.

Details

GeoTestIsotropy implements a likelihood ratio test (LRT) between:

  • H0: isotropic model with anisotropy parameters fixed at angle = 0, ratio = 1;

  • H1: anisotropic model with angle and ratio estimated.

The observed statistic is \(\mathrm{LRT}_{\text{obs}} = 2(\ell_1 - \ell_0)\), truncated at zero if negative. The null distribution is approximated by simulating B datasets under H0 with parameters equal to the H0 fit, and recomputing the LRT. The p-value is computed as \((1 + \#\{\mathrm{LRT}_b \ge \mathrm{LRT}_{\text{obs}}\}) / (1 + B_{\text{valid}})\). The simulation method is selected explicitly through method. For method = "cholesky", simulations are generated with GeoSim; for method = "TB", simulations are generated with GeoSimapprox using L spectral components. If parallel = TRUE, GeoSimapprox may parallelize over the B simulated replications, and the bootstrap refits may then be parallelized in a separate phase. The function saves and restores the user's future plan and progressr handlers.

If seed is supplied, the function temporarily calls set.seed(seed) before the observed fits, H0 simulations, and bootstrap refits. The previous random-number generator state is restored on exit, so using seed does not permanently modify the user's R session RNG state.

See Also

GeoVariogram for empirical variograms, GeoVariogramDir for directional variograms, GeoFit for covariance-model fitting.