| fs_oc_grid | R Documentation |
Evaluates every fs_oc_predict() quantity over the full crossing of
n, c1 and c2, enumerating the family and drawing the
candidates' fitted effects once per n (and per gate) and
sweeping the thresholds against those draws. Thresholds enter only the
gate, so the sweep costs arithmetic, not draws.
fs_oc_grid(
dgm = NULL,
forestsearch_args = list(),
n,
c1,
c2,
family = NULL,
consistency_method = c("resample", "split"),
pconsistency = NULL,
draws = 2e+05,
block = 50000,
seed = NULL,
verbose = FALSE,
...
)
dgm |
An object of class |
forestsearch_args |
Named list of |
n |
Numeric vector of trial sizes. |
c1, c2 |
Numeric vectors of screening and consistency floors; the grid
is their full crossing with |
family |
|
consistency_method |
|
pconsistency |
Numeric in (0, 1). Consistency-rate threshold
for the |
draws |
Integer. Number of Monte-Carlo draws. |
block |
Integer or |
seed |
Integer or |
verbose |
Logical. Report per- |
... |
Passed to |
For each n the family is enumerated with
fs_oc_family_enumerate (or the supplied family is used
when its n matches), the draw set is generated under seed
(the same seed for every n: common random numbers across trial
sizes), and every (c1, c2) is evaluated on it. With
block = Inf the whole draw set is held and the computation is exactly
fs_oc_predict's – one grid point is identical() to a
call of fs_oc_predict() at the same settings and seed. With a finite
block the draws are generated in row blocks of that size and the
quantities accumulated, so memory is O(block x M) instead of O(draws x M);
blocked results agree with the one-block results to Monte-Carlo precision
(the RNG stream is laid out differently and proportions are formed as
count / draws), not bit-for-bit.
An object of class c("fs_oc_grid", "list"):
tableData frame, one row per (n, gate, c1, c2):
n, consistency_method, pconsistency, c1, c2, M, draws, block,
seed, det_rate, det_rate_se, EnH, Esens, Espec, Eppv, Enpv, EbetaH,
Enaive_bias, mass_below.
resultsList, parallel to the rows of table, of the
full per-point objects (class fs_oc_predict, with P1,
p_sel, sel_c and their MC SEs).
familiesPer n: M, the floor, the stage
counts and the family.
timingPer n and gate: seconds for enumeration,
drawing and sweeping.
settingsThe call's settings.
fs_oc_predict, fs_oc_invert
piQ <- 0.34
fam <- structure(list(
lab = c("Q", "P", "D"), Pg = c(piQ, 0.45, 0.31),
PQg = c(1, 0.28 / 0.45, 1), sens_g = c(1, 0.28 / piQ, 0.31 / piQ),
spec_g = c(1, 1 - 0.17 / (1 - piQ), 1),
ovl = matrix(c(piQ, 0.28, 0.31, 0.28, 0.45, 0.28 * 0.31 / piQ,
0.31, 0.28 * 0.31 / piQ, 0.31), 3, 3),
M = 3L, PQ = piQ, n = 500), class = c("fs_oc_family", "list"))
fam$beta_g <- 26 + 14 * fam$PQg
fam$se_g <- 13.7 * sqrt(2) * sqrt(piQ / fam$Pg)
g <- fs_oc_grid(family = fam, n = 500, c1 = c(20, 30, 40), c2 = 10,
consistency_method = "resample", draws = 2e4, seed = 1)
g
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.