[][src]Trait statrs::statistics::Max

pub trait Max<T> {
    fn max(&self) -> T;
}

The Max trait specifies that an object has a maximum value

Required methods

fn max(&self) -> T

Returns the maximum value in the domain of a given distribution representable by a double-precision float. May panic depending on the implementor.

Examples

use statrs::statistics::Max;
use statrs::distribution::Uniform;

let n = Uniform::new(0.0, 1.0).unwrap();
assert_eq!(1.0, n.max());
Loading content...

Implementations on Foreign Types

impl Max<f64> for [f64][src]

fn max(&self) -> f64[src]

Returns the maximum value in the data

Remarks

Returns f64::NAN if data is empty or an entry is f64::NAN

Examples

use std::f64;
use statrs::statistics::Max;

let x: [f64; 0] = [];
assert!(x.max().is_nan());

let y = [0.0, f64::NAN, 3.0, -2.0];
assert!(y.max().is_nan());

let z = [0.0, 3.0, -2.0];
assert_eq!(z.max(), 3.0);
Loading content...

Implementors

impl Max<f64> for Beta[src]

fn max(&self) -> f64[src]

Returns the maximum value in the domain of the beta distribution representable by a double precision float

Formula

This example is not tested
1

impl Max<f64> for Cauchy[src]

fn max(&self) -> f64[src]

Returns the maximum value in the domain of the cauchy distribution representable by a double precision float

Formula

This example is not tested
INF

impl Max<f64> for Chi[src]

fn max(&self) -> f64[src]

Returns the maximum value in the domain of the chi distribution representable by a double precision float

Formula

This example is not tested
INF

impl Max<f64> for ChiSquared[src]

fn max(&self) -> f64[src]

Returns the maximum value in the domain of the chi-squared distribution representable by a double precision float

Formula

This example is not tested
INF

impl Max<f64> for Erlang[src]

fn max(&self) -> f64[src]

Returns the maximum value in the domain of the erlang distribution representable by a double precision float

Formula

This example is not tested
INF

impl Max<f64> for Exponential[src]

fn max(&self) -> f64[src]

Returns the maximum value in the domain of the exponential distribution representable by a double precision float

Formula

This example is not tested
INF

impl Max<f64> for FisherSnedecor[src]

fn max(&self) -> f64[src]

Returns the maximum value in the domain of the fisher-snedecor distribution representable by a double precision float

Formula

This example is not tested
INF

impl Max<f64> for Gamma[src]

fn max(&self) -> f64[src]

Returns the maximum value in the domain of the gamma distribution representable by a double precision float

Formula

This example is not tested
INF

impl Max<f64> for InverseGamma[src]

fn max(&self) -> f64[src]

Returns the maximum value in the domain of the inverse gamma distribution representable by a double precision float

Formula

This example is not tested
INF

impl Max<f64> for LogNormal[src]

fn max(&self) -> f64[src]

Returns the maximum value in the domain of the log-normal distribution representable by a double precision float

Formula

This example is not tested
INF

impl Max<f64> for Normal[src]

fn max(&self) -> f64[src]

Returns the maximum value in the domain of the normal distribution representable by a double precision float

Formula

This example is not tested
INF

impl Max<f64> for Pareto[src]

fn max(&self) -> f64[src]

Returns the maximum value in the domain of the Pareto distribution representable by a double precision float

Formula

This example is not tested
INF

impl Max<f64> for StudentsT[src]

fn max(&self) -> f64[src]

Returns the maximum value in the domain of the student's t-distribution representable by a double precision float

Formula

This example is not tested
INF

impl Max<f64> for Triangular[src]

fn max(&self) -> f64[src]

Returns the maximum value in the domain of the triangular distribution representable by a double precision float

Remarks

The return value is the same max used to construct the distribution

impl Max<f64> for Uniform[src]

impl Max<f64> for Weibull[src]

fn max(&self) -> f64[src]

Returns the maximum value in the domain of the weibull distribution representable by a double precision float

Formula

This example is not tested
INF

impl Max<i64> for DiscreteUniform[src]

fn max(&self) -> i64[src]

Returns the maximum value in the domain of the discrete uniform distribution

Remarks

This is the same value as the maximum passed into the constructor

impl Max<u64> for Bernoulli[src]

fn max(&self) -> u64[src]

Returns the maximum value in the domain of the bernoulli distribution representable by a 64- bit integer

Formula

This example is not tested
1

impl Max<u64> for Binomial[src]

fn max(&self) -> u64[src]

Returns the maximum value in the domain of the binomial distribution representable by a 64-bit integer

Formula

This example is not tested
n

impl Max<u64> for Categorical[src]

fn max(&self) -> u64[src]

Returns the maximum value in the domain of the categorical distribution representable by a 64-bit integer

Formula

This example is not tested
n

impl Max<u64> for Geometric[src]

fn max(&self) -> u64[src]

Returns the maximum value in the domain of the geometric distribution representable by a 64-bit integer

Formula

This example is not tested
2^63 - 1

impl Max<u64> for Hypergeometric[src]

fn max(&self) -> u64[src]

Returns the maximum value in the domain of the hypergeometric distribution representable by a 64-bit integer

Formula

This example is not tested
min(K, n)

where K is successes and n is draws

impl Max<u64> for Poisson[src]

fn max(&self) -> u64[src]

Returns the maximum value in the domain of the poisson distribution representable by a 64-bit integer

Formula

This example is not tested
2^63 - 1
Loading content...