Skip to contents

Selection never fits a prediction model. Equal scores are resolved by UTF-8 animal identity. Random ranks are keyed by identity and seed, independently of input order; sampling without replacement has quota/eligible probabilities.

Usage

gsim_select(
  animals,
  n,
  scores = NULL,
  method = c("random", "score"),
  strata = NULL,
  eligible = rep(TRUE, length(animals)),
  seed = 1,
  oracle = FALSE
)

Arguments

animals

Unique candidate IDs.

n

One quota or a named quota vector exactly covering strata.

scores

Named finite scores for all eligible animals when method is "score"; predictions are supplied by an external caller.

method

"random" or "score".

strata

Optional stratum labels aligned to animals.

eligible

Logical eligibility mask aligned to animals.

seed

Nonnegative identity-stream seed.

oracle

Logical provenance flag explicitly marking simulation-truth selection.

Value

Selection table for eligible animals, including scores, selected mask and inclusion probabilities. Score selection has conditional 0/1 probabilities and does not establish positive population sampling support.