Skip to contents

Multi-start local ascent, giving a lower bound on the supremum: a larger value may exist where it did not look. Use it for diagnosis; see certify() for a global upper bound. Works on unbounded parts and continuous spaces, though the bound may then sit far below the supremum.

Usage

sup_lb(x, null, engine = exact_engine(), n_seeds = 200L, n_restarts = 25L)

Arguments

x

A random_variable.

null

A null_model.

engine

An engine spec for the expectation under P_theta, e.g. exact_engine(), gh_engine() or mc_engine().

n_seeds, n_restarts

Resolution of the search.

Value

A ripr_search, with properties sup_lb, its logarithm log_sup_lb, the theta attaining it and the part that theta lies in, alongside the random_variable and null searched.

Details

A variable with a log form (e.g. from likelihood(), *, /, +) is integrated in log space.

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)))
sup_lb(X, plurality)
#> <ripr_search>
#>   X = P[theta = (0.4, 0.35, 0.25)]
#>   under null_model: multinomial_family over 2 parts
#>   sup E[X] >= 0.1019608  (searched, not certified)
#>   attained at theta = (0.406, 0.406, 0.187), in part 1

# A continuous sample space is searched the same way, under a rule that
# integrates over it. Every evaluation is a quadrature rule here, so the
# search is run at a lower resolution than the enumerable one above.
gaussian <- gaussian_family(d = 2L)
halfspace <- null_model(
  gaussian,
  halfspace_region(normal = c(1, -1), offset = 0)
)
Y <- likelihood(gaussian(c(0, 0)))
sup_lb(
  Y,
  halfspace,
  engine = gh_engine(n_nodes = 9L),
  n_seeds = 20L,
  n_restarts = 2L
)
#> <ripr_search>
#>   X = P[theta = (0, 0)]
#>   under null_model: gaussian_family over 1 part
#>   sup E[X] >= 0.07958814  (searched, not certified)
#>   attained at theta = (-3.98e-09, -3.98e-09), in part 1