GeoTestIsotropy: Parametric Bootstrap Test for Spatial Isotropy

View source: R/GeoTestIsotropy.R

GeoTestIsotropyR Documentation

Parametric Bootstrap Test for Spatial Isotropy

Description

Performs a parametric-bootstrap test of spatial isotropy by comparing an isotropic model under the null hypothesis with a geometrically anisotropic model under the alternative. The test statistic is a likelihood-ratio or composite-likelihood-ratio statistic, and its null distribution is estimated by simulation from the fitted isotropic model.

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 = 10000,
 parallel = TRUE,
 ncores = NULL,
 progress = TRUE,
 seed = NULL)

Arguments

data

Numeric vector of observations.

coordx

Numeric matrix with exactly two columns containing the spatial coordinates. The number of rows must equal length(data).

start

Named list containing the covariance and marginal parameters to be estimated. Parameters angle and ratio must not be included, because they are handled internally by the isotropy test.

fixed

Named list containing the covariance and marginal parameters kept fixed. Together, start and fixed must contain exactly the parameters required by CorrParam(corrmodel) and NuisParam(model).

optimizer

Optimization algorithm passed to GeoFit.

model

Marginal random-field model.

corrmodel

Spatial correlation model.

lower, upper

Named lists of lower and upper bounds for the parameters in start. Missing bounds are replaced by -Inf and Inf, respectively.

B

Number of parametric-bootstrap replications.

likelihood

Likelihood type passed to GeoFit. If both likelihood and type are NULL, full likelihood is used for at most 2000 observations and marginal pairwise composite likelihood is used otherwise.

type

Likelihood type passed to GeoFit; typically "Standard" for full likelihood or "Pairwise" for composite likelihood. It must be supplied together with likelihood.

copula

Optional copula specification. When a copula is supplied, only method = "cholesky" is currently supported.

neighb

Number of nearest neighbours used when type = "Pairwise". Ignored otherwise.

method

Simulation method under the null hypothesis. Use "cholesky" for exact simulation through GeoSim, or "TB" for approximate turning-bands simulation through GeoSimapprox.

L

Number of spectral components used when method = "TB".

parallel

Logical; if TRUE, bootstrap refits may be distributed across multiple R sessions.

ncores

Number of parallel workers. If NULL, it is selected automatically.

progress

Logical; if TRUE, display progress information through progressr.

seed

Optional finite numeric seed. The previous random-number-generator state is restored when the function exits.

Details

The null and alternative hypotheses are

H_0: \mathrm{ratio}=1,

and

H_1: \mathrm{ratio}>1,

with the anisotropy angle estimated under the alternative. Under H_0, the angle is not identifiable. Consequently, the usual chi-squared reference distribution for the likelihood-ratio statistic is not used. Instead, the null distribution is estimated by parametric bootstrap.

The observed statistic is

T_{\mathrm{obs}}=\max\{0,2(\ell_1-\ell_0)\},

where \ell_0 and \ell_1 are the maximized likelihoods or composite likelihoods under the isotropic and anisotropic models. Bootstrap datasets are simulated from the fitted isotropic model, and both models are refitted to each simulated dataset. The bootstrap p-value is

\frac{1+\sum_b I(T_b \geq T_{\mathrm{obs}})}{1+B_{\mathrm{valid}}}.

The anisotropic model is normally fitted once, starting from angle = 0 and ratio = 1.2. An adaptive multi-start fallback is used only if that fit fails or gives a smaller likelihood than the isotropic fit. In that case, additional starting angles are tried and the fit with the largest likelihood is retained. The same estimation rule is used for the observed data and for every bootstrap replication.

For pairwise composite likelihood, the isotropic and anisotropic fits must use the same retained pairs. The function checks this condition before computing the likelihood-ratio statistic.

The estimates obtained from the observed fits are used as starting values in the bootstrap refits. Failed bootstrap replications are removed from the empirical null distribution and are reported in the returned object. A warning is issued when fewer than 80 percent of the replications are successful or when fewer than 20 valid bootstrap statistics are available.

Value

An invisible list with components:

statistic

Observed likelihood-ratio statistic.

pvalue

Parametric-bootstrap p-value.

ratio_hat

Estimated anisotropy ratio under the alternative.

angle_hat

Estimated anisotropy angle under the alternative.

corrmodel

Correlation model used in the test.

model

Marginal model used in the test.

likelihood

Likelihood type used in the fits.

type

Likelihood construction used in the fits.

method

Simulation method used under the null hypothesis.

L

Number of turning-bands components, or NULL when not used.

seed

Seed supplied by the user, or NULL.

fit_H0

Fitted isotropic GeoFit object.

fit_H1

Fitted anisotropic GeoFit object.

observed_fallback_used

Logical indicating whether the adaptive multi-start fallback was used for the observed anisotropic fit.

observed_H1_attempts

Number of anisotropic fitting attempts for the observed data.

B_rep

Vector of valid bootstrap likelihood-ratio statistics.

bootstrap_B

Requested number of bootstrap replications.

bootstrap_successful

Number of valid bootstrap replications.

bootstrap_success_rate

Proportion of valid bootstrap replications.

bootstrap_fallbacks

Number of bootstrap replications in which the adaptive multi-start fallback was activated.

bootstrap_attempts

Number of anisotropic fitting attempts used in each bootstrap replication.

bootstrap_failures

Data frame containing the indices and error messages of failed bootstrap replications.

Author(s)

Moreno Bevilacqua moreno.bevilacqua89@gmail.com https://sites.google.com/view/moreno-bevilacqua/home
Victor Morales Onate victor.morales@uv.cl https://sites.google.com/site/moralesonatevictor/
Christian Caamano-Carrillo chcaaman@ubiobio.cl https://www.researchgate.net/profile/Christian-Caamano

See Also

GeoFit, GeoSim, GeoSimapprox, GeoVariogramDir

Examples

## Not run: 
## Isotropy test for a Gaussian random field simulated under H0
set.seed(123)
n <- 500
coords <- cbind(runif(n), runif(n))

param <- list(
  mean = 0,
  nugget = 0,
  sill = 1,
  scale = 0.20,
  smooth = 0.5
)

z <- GeoSim(
  coordx = coords,
  corrmodel = "Matern",
  model = "Gaussian",
  param = param
)$data

start <- list(
  mean = 0,
  sill = 1,
  scale = 0.20,
  smooth = 0.5
)
fixed <- list(nugget = 0)

lower <- list(
  mean = -5,
  sill = 0.01,
  scale = 0.01,
  smooth = 0.05
)
upper <- list(
  mean = 5,
  sill = 5,
  scale = 1,
  smooth = 2.5
)

#iso_test <- GeoTestIsotropy(
#  data = z,
#  coordx = coords,
#  start = start,
#  fixed = fixed,
#  optimizer = "bobyqa",
#  model = "Gaussian",
#  corrmodel = "Matern",
#  lower = lower,
#  upper = upper,
#  B = 99,
#  likelihood = "Full",
#  type = "Standard",
#  method = "cholesky",
#  parallel =TRUE,
#  seed = 321)

#iso_test$statistic
#iso_test$pvalue

## End(Not run)

GeoModels documentation built on July 29, 2026, 5:06 p.m.