Struct UnitStudentT
pub(crate) struct UnitStudentT {
nu: f64,
scale: f64,
ln_gamma_ratio: f64,
ln_norm: f64,
}Expand description
A Student-t with ν > 2 degrees of freedom, scaled to unit variance.
Fields§
§nu: f64The degrees of freedom.
scale: f64s = √((ν − 2)/ν): Z = s·T.
ln_gamma_ratio: f64ln Γ((ν+1)/2) − ln Γ(ν/2).
ln_norm: f64ln of the standard t density’s constant, Γ((ν+1)/2)/(Γ(ν/2)·√(νπ)).
Implementations§
§impl UnitStudentT
impl UnitStudentT
fn upper_tail(&self, t: f64) -> f64
fn upper_tail(&self, t: f64) -> f64
P(T > t) for the standard t and t ≥ 0.
fn log_derivatives(&self, z: f64) -> (f64, f64)
fn log_derivatives(&self, z: f64) -> (f64, f64)
(f′/f, f″/f) of the unit-variance density at z.
pub(crate) fn cdf<R: Scalar>(&self, z: R) -> R
pub(crate) fn cdf<R: Scalar>(&self, z: R) -> R
The unit-variance CDF in the mode: the passive value, then
f·Δ + f′/2·Δ² + f″/6·Δ³ in Δ = z − z₀.
pub(crate) fn quantile_f64(&self, p: f64) -> f64
pub(crate) fn quantile_f64(&self, p: f64) -> f64
The unit-variance quantile, passive: Newton from the normal’s, safeguarded by a bracket and bisection.
§impl UnitStudentT
impl UnitStudentT
fn log_nu_derivatives<R: Scalar>(&self, lift: NuLift, z: R) -> (R, R)
fn log_nu_derivatives<R: Scalar>(&self, lift: NuLift, z: R) -> (R, R)
(g_ν, g_νν) of the log-density at z, in the mode.
pub(crate) fn cdf_nu_partials(&self, z: f64) -> (f64, f64)
pub(crate) fn cdf_nu_partials(&self, z: f64) -> (f64, f64)
(F_ν, F_νν) of the unit-variance CDF at z, passive: the
incomplete beta in Jet2 on ν, the scale √((ν−2)/ν) with it.
pub(crate) fn pdf_nu_correction<R: Scalar>(
&self,
lift: NuLift,
z: f64,
dnu: R,
) -> R
pub(crate) fn pdf_nu_correction<R: Scalar>( &self, lift: NuLift, z: f64, dnu: R, ) -> R
The relative change of the density at a passive z for a ν move
dnu (zero-valued, carrying the derivatives): g_ν·Δν + ½(g_νν + g_ν²)·Δν².
pub(crate) fn pdf_marked<R: Scalar>(&self, lift: NuLift, z: R, dnu: R) -> R
pub(crate) fn pdf_marked<R: Scalar>(&self, lift: NuLift, z: R, dnu: R) -> R
The density in the mode, lifted in ν by dnu: the value is
pdf’s, the ν-derivatives the log-density’s to second
order.
pub(crate) fn cdf_marked<R: Scalar>(&self, lift: NuLift, z: R, dnu: R) -> R
pub(crate) fn cdf_marked<R: Scalar>(&self, lift: NuLift, z: R, dnu: R) -> R
The CDF in the mode, lifted in ν by dnu: cdf plus
F_ν·Δν + f_ν·Δz·Δν + ½F_νν·Δν² about the passive point — exact to
second order jointly, every added term zero-valued.
pub(crate) fn quantile_marked<R: Scalar>(&self, lift: NuLift, p: R, dnu: R) -> R
pub(crate) fn quantile_marked<R: Scalar>(&self, lift: NuLift, p: R, dnu: R) -> R
The quantile in the mode, lifted in ν by dnu: quantile
then two Newton steps on the lifted CDF, each residual less its
passive value so the root does not move and the ν-derivatives are
carried to second order.
Trait Implementations§
§impl Clone for UnitStudentT
impl Clone for UnitStudentT
§fn clone(&self) -> UnitStudentT
fn clone(&self) -> UnitStudentT
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more