Defines the Gamma distribution, which has probability density function
\[ \pi(x) = \frac{\beta^\alpha}{\Gamma(\alpha)}x^{\alpha-1}\exp\left(-\beta x\right), \]
where \(\alpha\) and \(\beta\) are parameters in the distribution. For multivariate \(x\), it is assumed that all components of \(x\) are independent. However, each component can have different parameters \(\alpha\) and \(\beta\), which are specified as vectors in the constructor.
Definition at line 18 of file Gamma.h.
|
| Gamma (double alphaIn, double betaIn) |
|
| Gamma (Eigen::VectorXd const &alphaIn, Eigen::VectorXd const &betaIn) |
|
virtual | ~Gamma ()=default |
|
| Distribution (unsigned int varSizeIn, Eigen::VectorXi const &hyperSizesIn=Eigen::VectorXi()) |
|
virtual | ~Distribution ()=default |
|
virtual double | LogDensity (ref_vector< Eigen::VectorXd > const &inputs) |
| Evaluate the log-density. More...
|
|
virtual double | LogDensity (std::vector< Eigen::VectorXd > const &inputs) |
|
| VARIADIC_TO_REFVECTOR (LogDensity, Eigen::VectorXd, double) |
|
virtual Eigen::VectorXd | GradLogDensity (unsigned int wrt, std::vector< Eigen::VectorXd > const &inputs) |
|
template<typename... Args> |
Eigen::VectorXd | GradLogDensity (unsigned int wrt, Args... args) |
|
virtual Eigen::VectorXd | ApplyLogDensityHessian (unsigned int const inWrt1, unsigned int const inWrt2, std::vector< Eigen::VectorXd > const &input, Eigen::VectorXd const &vec) |
|
Eigen::VectorXd | Sample (ref_vector< Eigen::VectorXd > const &inputs) |
| Sample the distribution. More...
|
|
Eigen::VectorXd | Sample (std::vector< Eigen::VectorXd > const &inputs) |
|
Eigen::VectorXd | Sample () |
| Sample the distribution with no inputs. More...
|
|
| VARIADIC_TO_REFVECTOR (Sample, Eigen::VectorXd, Eigen::VectorXd) |
|
std::shared_ptr< Density > | AsDensity () |
| Returns a density built from this distribution. More...
|
|
std::shared_ptr< RandomVariable > | AsVariable () |
| Returns a random variable built from this distribution. More...
|
|
double Gamma::LogDensityImpl |
( |
ref_vector< Eigen::VectorXd > const & |
inputs | ) |
|
|
overrideprivatevirtual |
Implement the log-density.
If known, the log-density should be implemented by a child. If it is not overridden then the default behavior is to return negative infinity (-1.0*std::numeric_limits<double>::infinity()).
- Parameters
-
[in] | inputs | the vector of inputs to the log-density |
- Returns
- The log density
Reimplemented from muq::Modeling::Distribution.
Definition at line 29 of file Gamma.cpp.
References alpha, beta, and logConst.