Skip to main content

UnitStudentT

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: f64

The degrees of freedom.

§scale: f64

s = √((ν − 2)/ν): Z = s·T.

§ln_gamma_ratio: f64

ln Γ((ν+1)/2) − ln Γ(ν/2).

§ln_norm: f64

ln of the standard t density’s constant, Γ((ν+1)/2)/(Γ(ν/2)·√(νπ)).

Implementations§

§

impl UnitStudentT

pub(crate) fn new(nu: f64) -> Self

The unit-variance t with nu > 2 degrees of freedom.

fn upper_tail(&self, t: f64) -> f64

P(T > t) for the standard t and t ≥ 0.

pub(crate) fn cdf_f64(&self, z: f64) -> f64

The unit-variance CDF, passive.

pub(crate) fn pdf_f64(&self, z: f64) -> f64

The unit-variance density, passive.

fn log_derivatives(&self, z: f64) -> (f64, f64)

(f′/f, f″/f) of the unit-variance density at z.

pub(crate) fn pdf<R: Scalar>(&self, z: R) -> R

The unit-variance density in the mode.

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

The unit-variance quantile, passive: Newton from the normal’s, safeguarded by a bracket and bisection.

pub(crate) fn quantile<R: Scalar>(&self, p: R) -> R

The unit-variance quantile in the mode: the passive root, then the inverse series Δ = u − a·u² + (2a² − b)·u³ in u = (p − F(z₀))/f(z₀), a = f′/(2f), b = f″/(6f).

§

impl UnitStudentT

pub(crate) fn nu_lift(&self) -> NuLift

The ν-lift of this distribution.

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)

(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

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

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

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

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

§

fn clone(&self) -> UnitStudentT

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Copy for UnitStudentT

§

impl Debug for UnitStudentT

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.