MUQ  0.4.3
muq::Modeling::InverseGamma Class Reference

#include <InverseGamma.h>

Inheritance diagram for muq::Modeling::InverseGamma:

Detailed Description

Defines the inverse gamma distribution, which has probability density function

\[ \pi(x) = \frac{\beta^\alpha}{\Gamma(\alpha)}x^{-\alpha-1}\exp\left(-\frac{\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\).

Definition at line 17 of file InverseGamma.h.

Public Member Functions

 InverseGamma (double alphaIn, double betaIn)
 
 InverseGamma (Eigen::VectorXd const &alphaIn, Eigen::VectorXd const &betaIn)
 
virtual ~InverseGamma ()=default
 
- Public Member Functions inherited from muq::Modeling::Distribution
 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)
 
virtual Eigen::VectorXd GradLogDensity (unsigned int wrt, ref_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, ref_vector< Eigen::VectorXd > const &input, Eigen::VectorXd const &vec)
 
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< DensityAsDensity ()
 Returns a density built from this distribution. More...
 
std::shared_ptr< RandomVariableAsVariable ()
 Returns a random variable built from this distribution. More...
 

Public Attributes

const Eigen::VectorXd alpha
 
const Eigen::VectorXd beta
 
- Public Attributes inherited from muq::Modeling::Distribution
const unsigned int varSize
 
const Eigen::VectorXi hyperSizes
 

Constructor & Destructor Documentation

◆ InverseGamma() [1/2]

InverseGamma::InverseGamma ( double  alphaIn,
double  betaIn 
)

Definition at line 15 of file InverseGamma.cpp.

◆ InverseGamma() [2/2]

InverseGamma::InverseGamma ( Eigen::VectorXd const &  alphaIn,
Eigen::VectorXd const &  betaIn 
)

Definition at line 8 of file InverseGamma.cpp.

◆ ~InverseGamma()

virtual muq::Modeling::InverseGamma::~InverseGamma ( )
virtualdefault

Member Function Documentation

◆ ComputeConstant()

double InverseGamma::ComputeConstant ( Eigen::VectorXd const &  alphaIn,
Eigen::VectorXd const &  betaIn 
)
staticprivate

Definition at line 19 of file InverseGamma.cpp.

References logConst.

◆ LogDensityImpl()

double InverseGamma::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]inputsthe vector of inputs to the log-density
Returns
The log density

Reimplemented from muq::Modeling::Distribution.

Definition at line 29 of file InverseGamma.cpp.

References alpha, beta, and logConst.

◆ SampleImpl()

Eigen::VectorXd InverseGamma::SampleImpl ( ref_vector< Eigen::VectorXd > const &  inputs)
overrideprivatevirtual

Sample the distribution.

Reimplemented from muq::Modeling::Distribution.

Definition at line 40 of file InverseGamma.cpp.

References alpha, and beta.

Member Data Documentation

◆ alpha

const Eigen::VectorXd muq::Modeling::InverseGamma::alpha

Definition at line 30 of file InverseGamma.h.

Referenced by LogDensityImpl(), and SampleImpl().

◆ beta

const Eigen::VectorXd muq::Modeling::InverseGamma::beta

Definition at line 31 of file InverseGamma.h.

Referenced by LogDensityImpl(), and SampleImpl().

◆ logConst

const double muq::Modeling::InverseGamma::logConst
private

Definition at line 38 of file InverseGamma.h.

Referenced by ComputeConstant(), and LogDensityImpl().


The documentation for this class was generated from the following files: