Skip to contents

\(w_c \leftarrow w_c G(\theta_c)\) with the atoms held fixed: the alternating-minimisation update of (Csiszár and Tusnády 1984) for the weights, which is also their exact EM (MM) step. Monotone in KL, but converges only slowly to the optimal weights; weight_step() solves for them in one go via SQP.

Usage

ct_step(state, times = 1L, record_gap = FALSE, until = NULL)

Arguments

state

A ripr_state.

times

Steps to take.

record_gap

Sweep the Frank–Wolfe oracle over the produced mixture, filling gap_after and caching it for gap_below() and fw_step(). Off by default: a full oracle sweep per row.

until

Optional predicate function(state, candidate) tested before each step; see predicates.

Value

The updated ripr_state.

Details

Stop with until = support_gap_below(tol), making times a budget. Convergence slows as atoms crowd together.

References

Csiszár I, Tusnády G (1984). “Information geometry and alternating minimization procedures.” Statistics and Decisions, Supplement Issue 1, 205–237.

Examples

set.seed(1)
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)))
  )
)
Q <- fam(c(0.4, 0.35, 0.25))
state <- ripr_init(Q, plurality) |>
  fw_step(times = 5L) |>
  ct_step(times = 20L, until = support_gap_below(1e-6))
state@trace$kl
#>  [1] 0.024511510 0.016814201 0.016233235 0.014378214 0.014067308 0.010669095
#>  [7] 0.010002118 0.009511166 0.009141214 0.008856601 0.008633351 0.008454880
#> [13] 0.008309464 0.008188689 0.008086449 0.007998274 0.007920876 0.007851827
#> [19] 0.007789325 0.007732028 0.007678932 0.007629284 0.007582512 0.007538183
#> [25] 0.007495961 0.007455589