Trait statrs::statistics::CheckedEntropy[][src]

pub trait CheckedEntropy<T> {
    fn checked_entropy(&self) -> Result<T>;
}

The CheckedEntropy trait specifies an object that has a closed form solutions for its entropy wih possible failure modes

Required methods

fn checked_entropy(&self) -> Result<T>[src]

Returns the entropy.

Examples

use statrs::statistics::CheckedEntropy;
use statrs::distribution::StudentsT;

let n = StudentsT::new(0.0, 2.0, 1.0).unwrap();
assert!(n.checked_entropy().is_err());
Loading content...

Implementors

impl CheckedEntropy<f64> for StudentsT[src]

fn checked_entropy(&self) -> Result<f64>[src]

Returns the entropy for the student’s t-distribution

Errors

If location != 0.0 && scale != 1.0

Formula

(v + 1) / 2 * (ψ((v + 1) / 2) - ψ(v / 2)) + ln(sqrt(v) * B(v / 2, 1 /
2))

where v is the freedom, ψ is the digamma function, and B is the beta function

Loading content...