Public Member Functions

BetaPrior Class Reference

beta prior More...

#include <prior.h>

Inheritance diagram for BetaPrior:
PsiPrior

List of all members.

Public Member Functions

 BetaPrior (double al, double bt)
 Initialize with parameters alpha=al, beta=bt.
 BetaPrior (const BetaPrior &original)
 copy constructor
double pdf (double x) const
 return beta pdf
double dpdf (double x)
 return derivative of beta pdf
double rand (void)
 draw a random number
PsiPriorclone (void) const
 draw a random number using rejection sampling
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
int get_code (void) const
 return the typcode of this prior
double cdf (double x) const
 return the typcode of this prior
double getprm (unsigned int prm) const
double ppf (double p, double start=NULL) const

Detailed Description

beta prior

This defines a beta prior distribution that is defined on an interval. It's pdf is defined by

\[ f(x) = \frac{x^{\alpha-1} (1-x)^{\beta-1}} {B(\alpha,\beta)}, \]

if $x\in(0,1)$. It is zero otherwise.


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