Skip to contents

The RIPr fit minimises \(KL(Q \| P)\) over mixtures P whose components lie in the null. An oracle proposes the next component to bring in; fw_step() and lb_step() differ only in how far ahead they look.

Details

Write \(P_i\) for the current mixture and \(G(\theta) = E_Q[P_\theta / P_i] = E_\theta[Q / P_i]\).

The Frank–Wolfe (Jaggi 2013) linear oracle fw_step() asks how fast KL falls as an infinitesimal amount of mass moves towards \(P_\theta\):

$$\left.\frac{d}{d\epsilon} KL\!\left(Q \,\|\, (1-\epsilon) P_i + \epsilon P_\theta\right)\right|_{\epsilon=0} = 1 - G(\theta).$$

Equivalently, it finds where in the null the likelihood ratio \(R_i=Q/P_i\) most fails to be an e-variable. The attained \(\sup_{\theta \in \Theta_0} G(\theta) = 1 + \mathrm{gap}\) bounds the KL suboptimality by Frank–Wolfe duality. Since the search is non-convex, the reported gap is only a lower bound on the true gap. It is the gap of the mixture the step started from, so it fills the previous row's gap_after.

The Li–Barron (Li and Barron 1999) greedy oracle lb_step() does not linearise; it picks the atom minimising KL after choosing its weight:

$$\theta^* = \arg\min_{\theta \in \Theta_0} KL\!\left(Q \,\|\, (1 - w(\theta)) P_i + w(\theta) P_\theta\right),$$

where \(w(\theta)\) comes from the weight update. Each candidate may therefore cost a line search, or a full weight solve under correction. It has no duality bound; record_gap = TRUE estimates the Frank–Wolfe gap with an extra linear-oracle sweep, without adding its atom.

What a trace row records

Every verb writes one row per step to state@trace. A row spans a step, so its columns split by which mixture they measure.

step, phase

The row's index (ripr_init()'s row is 0) and the verb that wrote it: "init", or the verb's name without _step, such as "fw" for fw_step(). Count steps of a kind with e.g. cumsum(trace$phase == "fw").

oracle_value, oracle_theta

What the step's own search found at the mixture it stepped from. For fw_step(), oracle_theta is the linear oracle's maximiser and oracle_value is NA (its value is the previous row's gap_after + 1); likewise for sfw_step(), whose kl is measured after the slide. For lb_step() oracle_value is the Li–Barron objective, not a gap; for weight_step() and ct_step() it is the support gap before the step, plus one, with no oracle_theta. When part is not NA, the atom went to oracle_theta.

kl, gap_after, gap_after_theta, gap_after_part

The mixture the row produced, and the linear oracle's gap, maximiser and part for it. Filled by record_gap = TRUE or the next fw_step(); otherwise NA.

gap_after_elapsed

Seconds the search that filled gap_after took.

part, step_size, direction, support_size, max_weight

Where an oracle step put its atom (NA if none), the step length and direction, and the size and heaviest weight of the produced mixture.

elapsed

Seconds of the step rule's work, excluding diagnostics (record_gap, snapshot, until). An fw_step() row includes the linear-oracle search it consumed, even if cached. Per step; use cumsum(trace$elapsed) for the total.

Both theta columns are list columns holding the family's parameter, with NA for rows that recorded none.

state@oracle caches the linear oracle's result for the current mixture only: a step that changes the mixture clears it and record_gap = TRUE sets it. fw_step() uses the cache when present, so an fw run pays one search per step. The final row's gap_after stays NA unless record_gap = TRUE or until stopped the run; ripr_finish(record_gap = TRUE) measures the mixture it returns.

Which to use

Prefer fw_step(): it is cheaper per iteration with similar guarantees (none of which strictly hold, since the oracle is heuristic).

Expect the two to disagree sharply on the gap even if the KL is similar. Frank–Wolfe places its atom exactly at the worst-case \(\theta\), absorbing the point that defines the gap; Li–Barron places it wherever post-step KL is smallest, leaving that point untouched.

References

Jaggi M (2013). “Revisiting Frank-Wolfe: Projection-free sparse convex optimization.” In International conference on machine learning, 427–435. PMLR.

Li J, Barron A (1999). “Mixture density estimation.” Advances in neural information processing systems, 12.

See also