Skip to contents

Checks a design plan by simulating studies at the recommended n and reporting how often the criterion actually reaches its target threshold. Usually, the planning search uses fewer replications than this check, so the two probabilities will not match exactly.

Usage

# S3 method for class 'ggm_design'
validate(
  plan,
  H = 500L,
  J = 100L,
  which_n = NULL,
  scope = NULL,
  seed = NULL,
  ...
)

Arguments

plan

A ggm_design object, as returned by design. It also inherits from bgm_design.

H, J

Outer and inner Monte Carlo replication counts, as in design. Defaults 500 and 100, larger than the planning defaults, since the check is run at a single n.

which_n

Which of the plan's recommended sizes to validate at. NULL (default) picks "global" for a DPIR plan and "h1" for a BFDA plan. DPIR plans also accept "pw", the parameterwise size; BFDA plans also accept "h0"; BSDA plans have only one size.

scope

BFDA only: whether to check the edge the plan was built around ("planning_edge") or every present edge in the graph ("all_edges"), the stricter guarantee check. NULL (default) means "planning_edge". This argument is ignored for DPIR plans.

seed

Random seed for reproducibility.

...

Ignored, present for consistency with the generic.

Value

A ggm_design_validation object, which also inherits from bgm_design_validation. Its n_star component is the size that was checked and results holds the probability achieved there. print and summary methods are available.

Examples

p <- 3
G <- matrix(0, p, p)
G[1, 2] <- G[2, 1] <- 1
K <- diag(p)
K[1, 2] <- K[2, 1] <- 0.3
ep <- elicit_prior(ggm_parameters(K, G, nu = 10))

set.seed(12)
plan <- design(ep,
  method = "DPIR", threshold = 0.5, target_probability = 0.5,
  H = 30, J = 10, n_tol = 10, max_n = 500
)

set.seed(12)
validate(plan, H = 30, J = 10) # H/J are kept small for a quick example
#> <design_validation>  method: DPIR   n* = 15 
#>   global Pr(DPIR > threshold) at n* : 0.997
#>   parameterwise Pr at n* : min 0.937 / median 0.957 / max 0.980