pub struct MultiAllocation {
pub n: Vec<usize>,
pub cost: f64,
pub attained: Vec<f64>,
pub bounded: bool,
pub multipliers: Vec<f64>,
}Expand description
Multivariate allocation: minimum cost sum c_h n_h such that the variance
of the estimated total of every study variable j is at most its target,
sum_h N_h^2 S_hj^2 / n_h - sum_h N_h S_hj^2 <= V0_j (Bethel 1989;
Chromy 1987). sd is H x J row-major (one column per variable, in the
same units as targets). The Lagrangian solution n_h = sqrt(sum_j mu_j a_hj / c_h) is found by multiplicative updates of the multipliers; strata
whose solution exceeds their size are taken completely and the rest
re-solved; every stratum keeps at least two units. Returns the allocation
and, in attained, the variance of each variable.
Fields§
§n: Vec<usize>§cost: f64§attained: Vec<f64>Variance attained for each variable.
bounded: boolWhether a bound (2 <= n_h <= N_h) moved the solution.
multipliers: Vec<f64>Multipliers of the constraints: zero for a constraint that is slack.