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 "InverseGammaJointPdf<V,M>::actualValue()",
77 "InverseGammaJointPdf<V,M>::actualValue()",
78 "incomplete code for gradVector, hessianMatrix and hessianEffect calculations");
81 return exp(this->lnValue(domainVector,domainDirection,gradVector,hessianMatrix,hessianEffect));
84 template<
class V,
class M>
87 const V& domainVector,
88 const V* domainDirection,
91 V* hessianEffect)
const
95 "InverseGammaJointPdf<V,M>::lnValue()",
96 "incomplete code for gradVector, hessianMatrix and hessianEffect calculations");
99 for (
unsigned int i = 0; i < domainVector.sizeLocal(); ++i) {
100 result -= (m_alpha[i]+1.)*log(domainVector[i]);
101 result -= m_beta[i]/domainVector[i];
102 if (m_normalizationStyle == 0) {
106 result += m_logOfNormalizationFactor;
111 template<
class V,
class M>
117 if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
118 *m_env.subDisplayFile() <<
"Entering InverseGammaJointPdf<V,M>::computeLogOfNormalizationFactor()"
122 if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
123 *m_env.subDisplayFile() <<
"Leaving InverseGammaJointPdf<V,M>::computeLogOfNormalizationFactor()"
124 <<
", m_logOfNormalizationFactor = " << m_logOfNormalizationFactor
~InverseGammaJointPdf()
Destructor.
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.
double lnValue(const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const
TODO: Logarithm of the value of the Gamma PDF.
double computeLogOfNormalizationFactor(unsigned int numSamples, bool updateFactorInternally) const
Computes the logarithm of the normalization factor.
#define UQ_FATAL_TEST_MACRO(test, givenRank, where, what)
A templated class for handling sets.
InverseGammaJointPdf(const char *prefix, const VectorSet< V, M > &domainSet, const V &alpha, const V &beta)
Constructor.
double commonComputeLogOfNormalizationFactor(unsigned int numSamples, bool updateFactorInternally) const
Common method (to the derived classes) to compute the logarithm of the normalization factor...
unsigned int displayVerbosity() const
const BaseEnvironment & m_env
A class for handling Inverse Gamma joint PDFs.
A templated (base) class for handling joint PDFs.