Public Member Functions

GammaPrior Class Reference

gamma prior More...

#include <prior.h>

Inheritance diagram for GammaPrior:
PsiPrior nGammaPrior

List of all members.

Public Member Functions

 GammaPrior (double shape, double scale)
 Initialize a gamma prior.
 GammaPrior (const GammaPrior &original)
 copy constructor
virtual double pdf (double x) const
 return pdf at position x
virtual double dpdf (double x)
 return derivative of pdf
virtual double rand (void)
 draw a random number
PsiPriorclone (void) const
 clone by value
virtual double mean (void) const
 return the mean
double std (void) const
 return the standard deviation
void shrink (double xmin, double xmax)
 shrink the prior if it is broader than the range between xmin and xmax
virtual int get_code (void) const
 return the typcode of this prior
virtual double cdf (double x) const
 return the typcode of this prior
double getprm (unsigned int prm) const
virtual double ppf (double p, double start=NULL) const

Detailed Description

gamma prior

This defines a gamma prior that is defined for the positive axis. It's pdf is defined by

\[ f(x) = x^{k-1} \frac{\exp(-x/\theta)}{\theta^k\Gamma(k)}, \]

for positive numbers and it is zero otherwise.


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