Skip to contents

Fit the hierarchical spatial-GEV model over a set of gauged sites with a Bayesian MCMC and return the regional (site-averaged) frequency curve plus per-site GEV/quantile credible bands. Wraps the shared C++ SpatialGEVAnalysis.

Usage

spatial_gev_analysis(
  coordinates,
  at_site_data,
  cross_validation = FALSE,
  sampler = "DEMCz",
  iterations = 3000L,
  output_length = 10000L,
  credible_level = 0.9,
  seed = 12345L,
  number_of_chains = 4L,
  exceedance_probabilities = NULL,
  thinning_interval = -1L
)

Arguments

coordinates

numeric matrix (or list of length-2 vectors), one [x, y] row per site.

at_site_data

numeric matrix (or list of rows), [observations x sites] at-site maxima.

cross_validation

logical; run leave-one-site-out cross-validation (default FALSE).

sampler

MCMC sampler: "DEMCz" (default), "DEMCzs", "ARWMH", or "NUTS".

iterations

number of post-warmup MCMC iterations.

output_length

number of posterior samples used to build the credible band.

credible_level

credible-interval width (e.g. 0.90 for a 90% band).

seed

PRNG seed for the sampler (fixed for reproducibility).

number_of_chains

number of MCMC chains (default 4).

exceedance_probabilities

optional numeric vector of exceedance probabilities at which to tabulate the curve; when NULL, the 25 standard default ordinates are used.

thinning_interval

MCMC thinning interval; -1 (default) keeps the sampler's own default.

Value

A named list: the regional parameters/mode_curve/mean_curve/lower_ci/upper_ci

  • aic/bic/dic, site_count, the per-site site_location_mean/_lower/_upper (and the scale/shape analogues), site-0 site0_quantile_mean/_lower/_upper/_mode, and (when cross_validation) cv_site_prediction_errors/cv_site_rmse/cv_site_bias/cv_mae/ cv_rmse/cv_mean_bias.