Skip to contents

Same computation as certify(), returning the branch-and-bound tree: one row per node, per cell. The nodes live at any iteration tile their cell, so at K = 3 the vertices column ((K, K) matrices, one vertex per row) draws the partition at every step.

Usage

certify_trace(
  x,
  null,
  tol = 1e-06,
  max_splits = 20000L,
  max_coefficients = 1024^2,
  incumbent_at = NULL
)

Arguments

x

A random_variable.

null

A null_model.

tol

Stop once the bound is within tol of the best value found.

max_splits

Cap on branch-and-bound subdivisions per cell; a triangulated part gets max_splits in each of its cells.

max_coefficients

Refuse above this many Bernstein coefficients.

incumbent_at

(Optional) Points in the null at which to evaluate \(E_\theta[X]\) before the search, to seed it with the largest value: a parameter vector, or a matrix of them with one per row. Each point must lie in the null (checked via contains()). See "Speeding things up" above.

Value

A data frame with part, cell, id, parent, depth, born, retired, fate, upper, volume and a vertices list column, plus the certificate itself in the "certificate" attribute and the per-iteration bound in "trace". The certificate is the same ripr_certificate that certify() returns.

Details

Each cell is a separate run and id restarts at 1 in each, so group by cell before matching parent. A triangulated part contributes one tree per cell. Point cells, bounded in closed form, contribute no rows.

See also

Examples

fam <- multinomial_family(n_trials = 4L, k = 3L)
plurality <- null_model(
  fam,
  list(
    simplex_region(vertices = rbind(c(0.5, 0.5, 0), c(0, 1, 0), c(0, 0, 1))),
    simplex_region(vertices = rbind(c(0.5, 0, 0.5), c(0, 1, 0), c(0, 0, 1)))
  )
)
X <- likelihood(fam(c(0.4, 0.35, 0.25)))
nodes <- certify_trace(X, plurality, tol = 1e-6)
nrow(nodes)
#> [1] 38