25 #include <queso/InverseGammaJointPdf.h>
26 #include <queso/GslVector.h>
27 #include <queso/GslMatrix.h>
32 template<
class V,
class M>
39 BaseJointPdf<V,M>(((std::string)(prefix)+
"uni").c_str(),domainSet),
56 template<
class V,
class M>
61 template<
class V,
class M>
64 const V& domainVector,
65 const V* domainDirection,
68 V* hessianEffect)
const
72 queso_require_msg(!(domainDirection || gradVector || hessianMatrix || hessianEffect),
"incomplete code for gradVector, hessianMatrix and hessianEffect calculations");
75 return exp(this->lnValue(domainVector,domainDirection,gradVector,hessianMatrix,hessianEffect));
78 template<
class V,
class M>
81 const V& domainVector,
82 const V* domainDirection,
85 V* hessianEffect)
const
87 queso_require_msg(!(domainDirection || gradVector || hessianMatrix || hessianEffect),
"incomplete code for gradVector, hessianMatrix and hessianEffect calculations");
90 for (
unsigned int i = 0; i < domainVector.sizeLocal(); ++i) {
91 result -= (m_alpha[i]+1.)*log(domainVector[i]);
92 result -= m_beta[i]/domainVector[i];
93 if (m_normalizationStyle == 0) {
97 result += m_logOfNormalizationFactor;
102 template<
class V,
class M>
108 if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
109 *m_env.subDisplayFile() <<
"Entering InverseGammaJointPdf<V,M>::computeLogOfNormalizationFactor()"
113 if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
114 *m_env.subDisplayFile() <<
"Leaving InverseGammaJointPdf<V,M>::computeLogOfNormalizationFactor()"
115 <<
", m_logOfNormalizationFactor = " << m_logOfNormalizationFactor
unsigned int displayVerbosity() const
double computeLogOfNormalizationFactor(unsigned int numSamples, bool updateFactorInternally) const
Computes the logarithm of the normalization factor.
~InverseGammaJointPdf()
Destructor.
A templated class for handling sets.
A templated (base) class for handling joint PDFs.
double commonComputeLogOfNormalizationFactor(unsigned int numSamples, bool updateFactorInternally) const
Common method (to the derived classes) to compute the logarithm of the normalization factor...
A class for handling Inverse Gamma joint PDFs.
#define queso_require_equal_to_msg(expr1, expr2, msg)
const BaseEnvironment & m_env
#define queso_require_msg(asserted, msg)
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
double actualValue(const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const
Actual value of the Gamma PDF.
InverseGammaJointPdf(const char *prefix, const VectorSet< V, M > &domainSet, const V &alpha, const V &beta)
Constructor.
double lnValue(const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const
TODO: Logarithm of the value of the Gamma PDF.