queso-0.53.0
List of all members
QUESO::InverseGammaVectorRV< V, M > Class Template Reference

A class representing a vector RV constructed via Inverse Gamma distribution. More...

#include <InverseGammaVectorRV.h>

Inheritance diagram for QUESO::InverseGammaVectorRV< V, M >:
Inheritance graph
[legend]
Collaboration diagram for QUESO::InverseGammaVectorRV< V, M >:
Collaboration graph
[legend]

Public Member Functions

Constructor/Destructor methods
 InverseGammaVectorRV (const char *prefix, const VectorSet< V, M > &imageSet, const V &alpha, const V &beta)
 Default Constructor. More...
 
virtual ~InverseGammaVectorRV ()
 Virtual destructor. More...
 
I/O methods
void print (std::ostream &os) const
 TODO: Prints the vector RV. More...
 
- Public Member Functions inherited from QUESO::BaseVectorRV< V, M >
 BaseVectorRV (const char *prefix, const VectorSet< V, M > &imageSet)
 Constructor. More...
 
virtual ~BaseVectorRV ()
 Virtual destructor. More...
 
const BaseEnvironmentenv () const
 QUESO environment; access to private attribute m_env. More...
 
const VectorSet< V, M > & imageSet () const
 Image set of the vector RV; access to private attribute m_imageSet. More...
 
const BaseJointPdf< V, M > & pdf () const
 Posterior Density Function of the vector RV; access to private attribute m_pdf. More...
 
const BaseVectorRealizer< V, M > & realizer () const
 Finds a realization (sample) of the PDF of this vector RV; access to private attribute m_realizer. More...
 
const BaseVectorCdf< V, M > & subCdf () const
 Finds the Cumulative Distribution Function of this vector RV, considering only the sub-sequence of data; access to private attribute m_subCdf. More...
 
const BaseVectorCdf< V, M > & unifiedCdf () const
 Finds the Cumulative Distribution Function of this vector RV, considering the unified sequence of data; access to private attribute m_unifiedCdf. More...
 
const BaseVectorMdf< V, M > & mdf () const
 Finds the Mass Density Function of this vector RV; access to private attribute m_mdf. More...
 

Additional Inherited Members

- Protected Attributes inherited from QUESO::BaseVectorRV< V, M >
const BaseEnvironmentm_env
 
std::string m_prefix
 
const VectorSet< V, M > & m_imageSet
 
BaseJointPdf< V, M > * m_pdf
 
BaseVectorRealizer< V, M > * m_realizer
 
const BaseVectorCdf< V, M > * m_subCdf
 
const BaseVectorCdf< V, M > * m_unifiedCdf
 
const BaseVectorMdf< V, M > * m_mdf
 

Detailed Description

template<class V = GslVector, class M = GslMatrix>
class QUESO::InverseGammaVectorRV< V, M >

A class representing a vector RV constructed via Inverse Gamma distribution.

This class allows the user to compute the value of a Inverse Gamma PDF and to generate realizations (samples) from it.
The Inverse Gamma probability density function is defined over the support x > 0 given a shape parameters a and a scale parameter b is:

\[ y=f(x| a,b)= \frac{b^a}{\Gamma(a)} x^{-a - 1}\exp\left(-\frac{b}{x}\right)\]

where $ \Gamma(.) $ is the Gamma function:

\[ B(a,b)=\frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}=\frac{(a-1)!(b-1)!}{(a+b-1)!}.\]

The parameters a and b must all be positive, and the values x must lie on the interval $ (0, \infty)$.

Definition at line 61 of file InverseGammaVectorRV.h.

Constructor & Destructor Documentation

template<class V , class M >
QUESO::InverseGammaVectorRV< V, M >::InverseGammaVectorRV ( const char *  prefix,
const VectorSet< V, M > &  imageSet,
const V &  alpha,
const V &  beta 
)

Default Constructor.

Construct an Inverse Gamma vector RV with parameters alpha>0 and beta>0, whose variates live in imageSet. The constructor will check whether or not the data provided via imageSet belongs to $ (0, \infty)$, which is a requirement imposed by the Inverse Gamma distribution. If this condition is not satisfied, an error message will be displayed and the program will exit.

Definition at line 35 of file InverseGammaVectorRV.C.

References QUESO::BaseEnvironment::displayVerbosity(), QUESO::BaseVectorRV< V, M >::imageSet(), QUESO::BaseVectorRV< V, M >::m_env, QUESO::BaseVectorRV< V, M >::m_imageSet, QUESO::BaseVectorRV< V, M >::m_mdf, QUESO::BaseVectorRV< V, M >::m_pdf, QUESO::BaseVectorRV< V, M >::m_prefix, QUESO::BaseVectorRV< V, M >::m_realizer, QUESO::BaseVectorRV< V, M >::m_subCdf, QUESO::BaseVectorRV< V, M >::m_unifiedCdf, QUESO::BoxSubset< V, M >::maxValues(), QUESO::BoxSubset< V, M >::minValues(), queso_require_greater_equal_msg, and QUESO::BaseEnvironment::subDisplayFile().

40  :
41  BaseVectorRV<V,M>(((std::string)(prefix)+"uni").c_str(),imageSet)
42 {
43  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
44  *m_env.subDisplayFile() << "Entering InverseGammaVectorRV<V,M>::constructor()"
45  << ": prefix = " << m_prefix
46  << std::endl;
47  }
48 
49 // begin kemelli 2013-April-22 --------------------------
50 // InverseGamma dist is defined only in (0,inf)
51  const BoxSubset<V,M>* imageBox = dynamic_cast<const BoxSubset<V,M>* >(&imageSet);
52  double smallerOfMaxValues = imageBox->maxValues().getMinValue();
53  double smallerOfMinValues = imageBox->minValues().getMinValue();
54 
55  if( smallerOfMinValues < 0 )
56  {
57  std::cerr << "In InverseGammaVectorRV<V,M>::constructor()\n"
58  << "Inverse Gamma distribution is only defined in (0, infinity).\n"
59  << "The data provided is: \n"
60  << *imageBox
61  << "Sampling will not cover all interval.\n"
62  << std::endl;
63 
64  queso_require_greater_equal_msg(smallerOfMaxValues, 0, "invalid input: Inverse Gamma distribution is only defined in (0, infinity), and min(m_maxValues)<0");
65  }
66 // end kemelli 2013-April-22 --------------------------
67 
68  m_pdf = new InverseGammaJointPdf<V,M>(m_prefix.c_str(),
69  m_imageSet,
70  alpha,
71  beta);
72  m_realizer = new InverseGammaVectorRealizer<V,M>(m_prefix.c_str(),
73  m_imageSet,
74  alpha,
75  beta);
76  m_subCdf = NULL; // FIX ME: complete code
77  m_unifiedCdf = NULL; // FIX ME: complete code
78  m_mdf = NULL; // FIX ME: complete code
79 
80  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
81  *m_env.subDisplayFile() << "Leaving InverseGammaVectorRV<V,M>::constructor()"
82  << ": prefix = " << m_prefix
83  << std::endl;
84  }
85 }
unsigned int displayVerbosity() const
Definition: Environment.C:396
const VectorSet< V, M > & m_imageSet
Definition: VectorRV.h:117
BaseJointPdf< V, M > * m_pdf
Definition: VectorRV.h:118
std::string m_prefix
Definition: VectorRV.h:116
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:274
const BaseVectorCdf< V, M > * m_unifiedCdf
Definition: VectorRV.h:121
const BaseEnvironment & m_env
Definition: VectorRV.h:115
const VectorSet< V, M > & imageSet() const
Image set of the vector RV; access to private attribute m_imageSet.
Definition: VectorRV.C:79
const BaseVectorMdf< V, M > * m_mdf
Definition: VectorRV.h:122
#define queso_require_greater_equal_msg(expr1, expr2, msg)
Definition: asserts.h:90
const BaseVectorCdf< V, M > * m_subCdf
Definition: VectorRV.h:120
BaseVectorRealizer< V, M > * m_realizer
Definition: VectorRV.h:119
template<class V , class M >
QUESO::InverseGammaVectorRV< V, M >::~InverseGammaVectorRV ( )
virtual

Virtual destructor.

Definition at line 88 of file InverseGammaVectorRV.C.

89 {
90  delete m_mdf;
91  delete m_unifiedCdf;
92  delete m_subCdf;
93  delete m_realizer;
94  delete m_pdf;
95 }
BaseJointPdf< V, M > * m_pdf
Definition: VectorRV.h:118
const BaseVectorCdf< V, M > * m_unifiedCdf
Definition: VectorRV.h:121
const BaseVectorMdf< V, M > * m_mdf
Definition: VectorRV.h:122
const BaseVectorCdf< V, M > * m_subCdf
Definition: VectorRV.h:120
BaseVectorRealizer< V, M > * m_realizer
Definition: VectorRV.h:119

Member Function Documentation

template<class V , class M >
void QUESO::InverseGammaVectorRV< V, M >::print ( std::ostream &  os) const
virtual

TODO: Prints the vector RV.

Todo:
: implement me!

Implements QUESO::BaseVectorRV< V, M >.

Definition at line 99 of file InverseGammaVectorRV.C.

100 {
101  os << "InverseGammaVectorRV<V,M>::print() says, 'Please implement me.'" << std::endl;
102  return;
103 }

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

Generated on Thu Jun 11 2015 13:52:35 for queso-0.53.0 by  doxygen 1.8.5