Skip to contents

These settings often will not require adjustment on your part, they are mainly provided here in one place for troubleshooting.

Usage

ripr_control(
  n_seeds = 200L,
  n_restarts = 25L,
  search_xtol = 1e-08,
  search_max_eval = 1000L,
  slide_xtol = 1e-10,
  slide_max_eval = 2000L,
  weight_solver = c("sqp", "slsqp"),
  weight_sqp_tol = 1e-12,
  weight_slsqp_tol = 1e-10,
  weight_max_iter = 500L,
  merge_atol = 1e-09,
  merge_rtol = 1e-09,
  near_tol = 1e-06,
  snapshot = c("none", "step", "all")
)

Arguments

n_seeds

Search: random chart seeds per search.

n_restarts

Search: number of the best seeds refined by SLSQP per search.

search_xtol

Search: SLSQP's relative tolerance on chart coordinates when refining a seed. Near a maximum the objective is flat, so its value is accurate to roughly the square of this.

search_max_eval

Search: cap on objective evaluations per refined seed.

slide_xtol

Slide: SLSQP's relative tolerance on the joint weights and chart coordinates.

slide_max_eval

Slide: cap on objective evaluations per slide.

weight_solver

Weight solve: "sqp" (default) is an exact-Hessian sequential quadratic programming method (Nocedal and Wright 2006) , cf. mix-SQP (Kim et al. 2020) , which stops once the Frank–Wolfe gap over the current support is below weight_sqp_tol and falls back on "slsqp" if it doesn't converge. "slsqp" is nloptr's quasi-Newton SLSQP, which stops once the KL stops changing in floating point, which can leave the gap over the support much larger than weight_sqp_tol.

weight_sqp_tol

Weight solve, "sqp": the target KKT residual, the largest of \(|G_c - 1|\) over atoms with weight and the positive part of \(G_c - 1\) over atoms without.

weight_slsqp_tol

Weight solve, "slsqp" and the fallback: its relative tolerance on the weights.

weight_max_iter

Weight solve: cap on the iterations ("sqp") or objective evaluations ("slsqp") a solve may take.

merge_atol, merge_rtol

Merging: two atoms of the same part are the same point when every coordinate agrees to within merge_atol + merge_rtol * max(|a|, |b|). Applied after every step that adds or moves atoms and before every weight solve. Meant to catch atoms that coincide up to rounding; large values change the fit.

near_tol

Merging: points within this (absolute and relative) tolerance are treated as the same point. Used by, e.g. fw_step(insert = "multi"), which inserts every distinct local maximum the search found: restarts that ascend to the same local maximum end up about this close, so they are added as one atom rather than multiple, and a candidate this close to an existing atom is dropped. Candidates enter at weight zero, so merging them does not cost anything in KL or gap. Also used after each sfw_step() slide.

snapshot

How often to record the fitted mixture alongside the trace. "none" (default) never records the state; "step" records the atoms and weights once per step call (e.g. fw_step()), so fw_step(times = 10) yields one snapshot; "all" records once per iteration, yielding ten. The trace is always recorded; snapshots copy the whole mixture, so their memory cost grows with support size.

Value

A list of control settings for ripr_init().

Details

The defaults that can be overridden by ripr_control() are related to one of four tasks:

The linear oracle, the Li–Barron oracle and the EM atom step each maximise over the null by multi-start SLSQP in each part's chart.

Slide

sfw_step()'s joint SLSQP descent over every weight and atom position.

Weight solves

The corrective solve over the weights with fixed support (atom locations), correct_weights = TRUE, weight_step(), sfw_step() and ripr_finish(correct_weights = TRUE) all run solves for the optimal weights.

Merging

Two copies of one atom make the weight problem degenerate (its Hessian singular), so points of a part that are the same are merged into one at their weight-averaged position. Two tolerances say when: merge_atol and merge_rtol catch atoms that coincide up to rounding, and are applied unconditionally; near_tol catches distinct points that the search (for the supremum) found and merges them if they are close enough; here we assume they represent the same local optimum.

References

Kim Y, Carbonetto P, Stephens M, Anitescu M (2020). “A fast algorithm for maximum likelihood estimation of mixture proportions using sequential quadratic programming.” Journal of Computational and Graphical Statistics, 29(2), 261–273. doi:10.1080/10618600.2019.1689985 .

Nocedal J, Wright SJ (2006). Numerical Optimization, 2 edition. Springer, New York. doi:10.1007/978-0-387-40065-5 .

Examples

ripr_control(n_seeds = 50L, snapshot = "step")
#> $n_seeds
#> [1] 50
#> 
#> $n_restarts
#> [1] 25
#> 
#> $search_xtol
#> [1] 1e-08
#> 
#> $search_max_eval
#> [1] 1000
#> 
#> $slide_xtol
#> [1] 1e-10
#> 
#> $slide_max_eval
#> [1] 2000
#> 
#> $weight_solver
#> [1] "sqp"
#> 
#> $weight_sqp_tol
#> [1] 1e-12
#> 
#> $weight_slsqp_tol
#> [1] 1e-10
#> 
#> $weight_max_iter
#> [1] 500
#> 
#> $merge_atol
#> [1] 1e-09
#> 
#> $merge_rtol
#> [1] 1e-09
#> 
#> $near_tol
#> [1] 1e-06
#> 
#> $snapshot
#> [1] "step"
#>