mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
The Weibull Distribution

Utilities for working with the Weibull Distribution.

Functions

template<typename realT >
realT mx::math::func::weibull_lambda (std::vector< realT > &x, realT k, realT x0=0)
 The MLE of the Weibull distribution lambda parameter. More...
 
template<typename realT >
realT mx::math::func::weibull (realT x, realT x0, realT k, realT lambda)
 The general shifted Weibull distribution at a point. More...
 
template<typename realT >
realT mx::math::func::weibull (realT x, realT k, realT lambda)
 The Weibull distribution at a point. More...
 

Function Documentation

◆ weibull() [1/2]

template<typename realT >
realT mx::math::func::weibull ( realT  x,
realT  k,
realT  lambda 
)

The Weibull distribution at a point.

Calculates the value of the Weibull distribution at a location specified by x.

\[ f(x; \lambda, k) = \begin{cases} \frac{k}{\lambda}\left( \frac{x}{\lambda}\right)^{k-1} \exp \left( -\left(\frac{x}{\lambda}\right)^k \right), & x \ge 0 \\ 0, & x < 0 \end{cases} \]

Template Parameters
realTa real floating point type
Returns
the value of the Weibull distribution at x.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]xthe location at which to calculate the distribution
[in]kthe shape parameter
[in]lambdathe scale parameter

Definition at line 116 of file weibull.hpp.

References mx::astro::constants::k().

◆ weibull() [2/2]

template<typename realT >
realT mx::math::func::weibull ( realT  x,
realT  x0,
realT  k,
realT  lambda 
)

The general shifted Weibull distribution at a point.

Calculates the value of the Weibull distribution at a location specified by x.

\[ f(x; x_o, \lambda, k) = \begin{cases} \frac{k}{\lambda}\left( \frac{x-x_o}{\lambda}\right)^{k-1} \exp \left( -\left(\frac{x-x_o}{\lambda}\right)^k \right), & x \ge 0 \\ 0, & x < 0 \end{cases} \]

Template Parameters
realTa real floating point type
Returns
the value of the Weibull distribution at x.
Parameters
[in]xthe location at which to calculate the distribution
[in]x0the location parameter
[in]kthe shape parameter
[in]lambdathe scale parameter

Definition at line 81 of file weibull.hpp.

References mx::astro::constants::k().

◆ weibull_lambda()

template<typename realT >
realT mx::math::func::weibull_lambda ( std::vector< realT > &  x,
realT  k,
realT  x0 = 0 
)

The MLE of the Weibull distribution lambda parameter.

Template Parameters
realTa real floating point type
Returns
the MLE of lambda given the data.
Parameters
[in]xthe data points
[in]kthe shape parameter
[in]x0[optional] the location parameter

Definition at line 46 of file weibull.hpp.

References mx::astro::constants::k().