Draws sets uniformly between lower and upper and keeps those gates accepts, until n are kept or maxDraws have been drawn. Uniform draws over the wide bounds mostly saturate the logistic (spreadProb at its asymptote or floor everywhere), which the objective refuses ("Too burny a landscape", "Not spread out enough"); for ELF 14.3 fold 1 only about 7% of them pass.

drawActivePars(n, lower, upper, maxDraws, gates, cores = 1L)

Arguments

n

integer; number of parameter sets wanted.

lower, upper

named numeric; the bounds.

maxDraws

integer; cap on the number of draws.

gates

function of a list of parameter sets, returning a logical vector (TRUE = accepted). Evaluated in forked processes if cores > 1.

cores

integer; forks used to evaluate gates.

Value

list(pars =, drawn =, accepted =): the accepted sets (at most n), how many draws it took, and how many were accepted.

Details

The draws are one runif() stream from the seed set by the caller, so the result is reproducible; the batch sizes depend only on how many draws were accepted so far, which is deterministic. Drawing stops at the draw that made the nth acceptance, so drawn counts only the draws made use of.