A trial that bailed returns fireSenseUtils' failVal (1e6), plus the adTest term when that test is on. Anything below that is a real value, however large: an ELF's objective is a sum over its fires, so six-figure values are normal for a big ELF and must not be mistaken for failures.

pickThreshold(thresholds, objFun, failVal = 1e+06)

Arguments

thresholds

numeric; candidate thresholds.

objFun

objective value of each candidate; non-numeric or non-finite entries count as failed.

failVal

numeric; values at or above this are failed trials.

Value

the smallest non-failed threshold, or NA_real_ with a warning if every trial failed.