|
| template<typename Shape, typename Scale> |
| static std::expected< Gamma, GammaError > | create (Space_ space, Shape const &shape, Scale const &scale) |
template<typename Shape, typename Scale>
requires internal::SizedByLength<Space_> |
| static std::expected< Gamma, GammaError > | create (Shape const &shape, Scale const &scale) |
| | create() in the default space.
|
| template<typename Scale> |
| static std::expected< Gamma, GammaError > | exponential (Space_ space, Scale const &scale) |
|
template<typename Scale> |
| static std::expected< Gamma, GammaError > | exponential (Scale const &scale) |
| | exponential() in the default space.
|
| template<typename Dof> |
| static std::expected< Gamma, GammaError > | chiSquared (Space_ space, Dof const &dof) |
|
template<typename Dof> |
| static std::expected< Gamma, GammaError > | chiSquared (Dof const &dof) |
| | chiSquared() in the default space.
|
| template<typename Mean, typename StdDev> |
| static std::expected< Gamma, GammaError > | fromMeanAndStdDev (Space_ space, Mean const &mean, StdDev const &stdDev) |
|
template<typename Mean, typename StdDev> |
| static std::expected< Gamma, GammaError > | fromMeanAndStdDev (Mean const &mean, StdDev const &stdDev) |
| | fromMeanAndStdDev() in the default space.
|
template<Space Space_, RealScalar Scalar_ = double>
class Emrys::Gamma< Space_, Scalar_ >
Independent Gamma distributions on the coordinates, for positive quantities such as ranges, speeds, and rates.
The gamma distribution in its shape and scale parameterization. Coordinate \( i \) has shape \( k_i \) and scale \( \theta_i \):
\[ p(x_i) = \frac{x_i^{k_i - 1} e^{-x_i / \theta_i}}{\Gamma(k_i)\, \theta_i^{k_i}}, \quad x_i \ge 0, \]
with mean \( k_i \theta_i \) and variance \( k_i \theta_i^2 \). A shape of 1 is the exponential distribution (see exponential()); shape \( \nu / 2 \) with scale 2 is \( \chi^2_\nu \) (see chiSquared()). A shape above 1 puts the mode at \( (k - 1) \theta \), away from zero; fromMeanAndStdDev() picks the shape and scale for a given mean and spread.
static std::expected< Gamma, GammaError > create(Space_ space, Shape const &shape, Scale const &scale)
Definition Gamma.h:158
static std::expected< Gamma, GammaError > fromMeanAndStdDev(Space_ space, Mean const &mean, StdDev const &stdDev)
Definition Gamma.h:224
Every coordinate's space must contain all of [0, ∞) without wrapping it, as Linear does. The support is the distribution's own: the density is zero below zero, and no space keeps a value from going there [no-bounded-coordinates].
A Gamma is an immutable value that owns its parameters. Its factories check them, since a shape or scale is often computed at run time, and return a GammaError if one is not positive and finite; it has no public constructor [checked-factories].
- Template Parameters
-
| Space_ | space of the coordinates (see Spaces) |
| Scalar_ | scalar type, double by default |
- See also
- drawSamples(Gamma const &, Eigen::Index, G &)