neighborhood_HT: Homogeneous neighborhood selection

View source: R/neighborhood.R

neighborhood_HTR Documentation

Homogeneous neighborhood selection

Description

Identifies homogeneous neighbors around a given grid point using a combination of the Hosking-Wallis (1993) and Anderson-Darling (1987) tests for marginal homogeneity.

Usage

neighborhood_HT(
  data,
  coord,
  s0,
  miles = FALSE,
  min.neigh = 5,
  max.neigh = 20,
  pr = 0.9,
  alpha = 0.05,
  dmax = 150,
  which.test = c(1, 2)
)

Arguments

data

A matrix or data.frame. Each column corresponds to a station, with rows containing observations (on the original scale).

coord

A two-column matrix or data frame of station coordinates (longitude and latitude), one row per station.

s0

Numeric vector of length 2: the longitude and latitude of the target grid point.

miles

Logical; whether to compute distance in miles (default: FALSE).

min.neigh

Minimum number of neighbors to accept (default: 5).

max.neigh

Maximum number of neighbors to test (default: 20).

pr

Probability threshold for quantile filtering (e.g. 0.9).

alpha

Significance level for homogeneity tests.

dmax

Maximum distance (in km) to consider.

which.test

Integer vector specifying which test(s) to run:

  • 1 = HW test (Hosking–Wallis)

  • 2 = AD test (Anderson–Darling)

  • c(1, 2) = both tests

Value

A vector of station indices considered homogeneous with the grid point.

References

Castro-Camilo, D. and Huser, R. (2020). JASA 115, 1037–1054. Hosking, J. and Wallis, J. (1993). Water Resour. Res. 29, 271–281. Scholz, F.W. and Stephens, M.A. (1987). JASA 82, 918–924.

See Also

fdata()

Examples


neighborhood_HT(counterfactual, coord = LonLat, s0 = c(30, 39), which.test = c(1, 2))



eFCM documentation built on Sept. 9, 2025, 5:52 p.m.