Skip to contents

suggest_tuning_grid() uses empirical sampling-site distances to suggest candidate values for tune_popmaps() and adaptive_tune_popmaps(). The suggestions are intended as a transparent starting point, not as universal defaults.

Usage

suggest_tuning_grid(
  input_locs,
  num_sites = NULL,
  num_tested = NULL,
  empirical_pt_dist_probs = c(0.05, 0.1, 0.25),
  distance_weights = c(0.95, 0.75, 0.5, 0.25, 0.1, 0.05),
  distance_reference = c("median", "mean"),
  max_num_tested = 8
)

Arguments

input_locs

A data frame or matrix with sampling location name, longitude, latitude, and one or more ancestry coefficient columns.

num_sites

Optional integer vector of candidate site-pool sizes.

num_tested

Optional integer vector of candidate numbers of sites used in each prediction.

empirical_pt_dist_probs

Distance quantiles used to suggest empirical_pt_dist, after always including zero.

distance_weights

Desired weights retained at the reference distance; converted to popmod values with log(weight) / reference_distance.

distance_reference

Which site-distance summary to use as the reference distance for popmod.

max_num_tested

Maximum automatically suggested num_tested value.

Value

A popmaps_tuning_grid list with suggested parameter vectors and empirical distance summaries.

Examples

grid <- suggest_tuning_grid(hija_struc)
grid
#> Suggested POPMAPS tuning grid
#> Distance units: km
#> Reference distance: 199.766 (median)
#> num_sites: 5, 8, 11, 15
#> num_tested: 2, 3, 4, 5
#> empirical_pt_dist: 0, 64.128, 94.372, 131.866
#> popmod: -0.015, -0.01153, -0.00694, -0.00347, -0.00144, -0.0002568