Skip to main content

beta_inv

Function beta_inv 

Source
pub fn beta_inv(q: f64, a: f64, b: f64) -> f64
Expand description

The inverse of beta_inc in $x$: the $q$ quantile of $\mathrm{Beta}(a, b)$, by bisection on $[0, 1]$ (0 and 1 at the ends of $q$).

§Examples

use comnum_math::{beta_inc, beta_inv};
let x = beta_inv(0.975, 3.5, 4.5);
assert!((x - 0.765_498_750_747_906_2).abs() < 1e-14);
assert!((beta_inc(3.5, 4.5, x) - 0.975).abs() < 1e-14);