Skip to main content

compute_lloyd_max_beta_codebook

Function compute_lloyd_max_beta_codebook 

Source
pub fn compute_lloyd_max_beta_codebook(
    dim: usize,
    num_levels: usize,
) -> Vec<f64>
Expand description

Compute Lloyd-Max codebook for Beta((d-1)/2, (d-1)/2) scaled to [-1, 1].

The exact distribution of a coordinate of a unit vector uniform on S^{d-1} is Beta((d-1)/2, (d-1)/2) on [-1, 1]. For large d this converges to N(0, 1/d).

Uses numerical integration via trapezoidal rule for the conditional expectations.