A class to represent the prior of a parameter. More...
#include <BCPrior.h>
Public Member Functions | |
Constructors and destructors | |
BCPrior () | |
Empty constructor. | |
BCPrior (const BCPrior &other) | |
Copy constructor. | |
virtual | ~BCPrior () |
Destructor. | |
methods that must be overloaded in derived classes | |
virtual double | GetLogPrior (double x)=0 |
Get log of prior. More... | |
virtual BCPrior * | Clone () const =0 |
Clone function. More... | |
virtual bool | IsValid () const =0 |
Getters | |
virtual double | GetLogNormalizedPrior (double x) |
Get log of normalized prior. More... | |
virtual double | GetPrior (double x, bool normalize=false) |
Get prior. More... | |
virtual TF1 & | GetFunction () |
Return back ROOT TF1 evaluating BCPrior::GetPrior. | |
virtual const TF1 & | GetFunction () const |
Return back ROOT TF1 evaluating BCPrior::GetPrior. | |
virtual void | SetFunctionRange (double xmin, double xmax) |
Set range of ROOT TF1 function. More... | |
virtual double | GetMode (double xmin=-std::numeric_limits< double >::infinity(), double xmax=std::numeric_limits< double >::infinity()) |
Return mode of prior (in range). More... | |
virtual double | GetRawMoment (unsigned n, double xmin=-std::numeric_limits< double >::infinity(), double xmax=std::numeric_limits< double >::infinity()) |
Get raw moment of prior distrubion. More... | |
virtual double | GetIntegral (double xmin=-std::numeric_limits< double >::infinity(), double xmax=std::numeric_limits< double >::infinity()) |
Get integral of prior. More... | |
virtual double | GetCentralMoment (unsigned n, double xmin=-std::numeric_limits< double >::infinity(), double xmax=std::numeric_limits< double >::infinity()) |
Get central moment of prior distrubion. More... | |
virtual double | GetStandardizedMoment (unsigned n, double xmin=-std::numeric_limits< double >::infinity(), double xmax=std::numeric_limits< double >::infinity()) |
Get standardised moment of prior distrubion. More... | |
virtual double | GetMean (double xmin=-std::numeric_limits< double >::infinity(), double xmax=std::numeric_limits< double >::infinity()) |
Get mean of prior. More... | |
virtual double | GetVariance (double xmin=-std::numeric_limits< double >::infinity(), double xmax=std::numeric_limits< double >::infinity()) |
Get variance of prior. More... | |
virtual double | GetStandardDeviation (double xmin=-std::numeric_limits< double >::infinity(), double xmax=std::numeric_limits< double >::infinity()) |
Get standard deviation of prior. More... | |
virtual double | GetSkewness (double xmin=-std::numeric_limits< double >::infinity(), double xmax=std::numeric_limits< double >::infinity()) |
Get skewness of prior. More... | |
virtual double | GetKurtosis (double xmin=-std::numeric_limits< double >::infinity(), double xmax=std::numeric_limits< double >::infinity()) |
Get kurtosis of prior. More... | |
virtual double | GetRandomValue (double xmin, double xmax, TRandom *const R=NULL) |
Functions related to ROOT access. | |
virtual double | GetPriorForROOT (double *x, double *) |
For accessing prior as ROOT TF1. | |
virtual double | GetNormalizedPriorForROOT (double *x, double *) |
For accessing normalized prior as ROOT TF1. | |
virtual double | GetLogPriorForROOT (double *x, double *) |
For accessing log(prior) as ROOT TF1. | |
virtual double | GetNormalizedLogPriorForROOT (double *x, double *) |
For accessing normalized log(prior) as ROOT TF1. | |
virtual double | CalculateAndStoreIntegral (double xmin=-std::numeric_limits< double >::infinity(), double xmax=std::numeric_limits< double >::infinity()) |
Calculate and store integral for use in normalized TF1s. | |
virtual void | StoreIntegral (double I) |
Store integral;. | |
virtual void | StoreLogIntegral (double logI) |
Store log(integral);. | |
virtual double | GetStoredIntegral () const |
Get stored integral. More... | |
virtual double | GetStoredLogIntegral () const |
Get stored integral. More... | |
virtual void | FillHistogramByCenterValue (TH1 *h) |
Fill histogram by prior evaluated at bin center. More... | |
virtual void | FillHistogramByIntegral (TH1 *h) |
Fill histogram by integrating prior over bin and dividing by bin width. More... | |
virtual BCH1D | GetBCH1D (TH1 *bins, const std::string &name="prior") |
Get BCH1D object for prior. More... | |
virtual BCH2D | GetBCH2D (BCPrior *ordinate, TH2 *bins, const std::string &name="prior") |
Get BCH2D object for prior. More... | |
Protected Attributes | |
double | fLogIntegral |
Log of integral of unnormalized pdf over the range. | |
TF1 | fPriorFunction |
Friends | |
operators and swap | |
void | swap (BCPrior &A, BCPrior &B) |
swap | |
Detailed Description
A class to represent the prior of a parameter.
- Version
- 1.0
- Date
- 01.2015
Member Function Documentation
|
pure virtual |
Clone function.
[Copy constructor must also be provided.]
Implemented in BCPositiveDefinitePrior, BCTH1Prior, BCConstantPrior, BCTF1LogPrior, BCSplitGaussianPrior, BCTF1Prior, BCGaussianPrior, and BCCauchyPrior.
|
virtual |
Fill histogram by prior evaluated at bin center.
Definition at line 140 of file BCPrior.cxx.
|
virtual |
Fill histogram by integrating prior over bin and dividing by bin width.
Definition at line 149 of file BCPrior.cxx.
|
virtual |
Get BCH1D object for prior.
- Parameters
-
bins pointer to TH1 object defining binning to use (and axis names) name name to assigned to the histogram created for BCH1D object
- Returns
- BCH1D object for prior.
Reimplemented in BCTH1Prior.
Definition at line 159 of file BCPrior.cxx.
|
virtual |
Get central moment of prior distrubion.
If limits are infinite, use exact value from prior type.
- Parameters
-
n moment number xmin lower limit of range to evaluate over xmax upper limit of range to evaluate over
- Returns
- central of prior distribution
Reimplemented in BCPositiveDefinitePrior.
Definition at line 88 of file BCPrior.cxx.
|
virtual |
Get integral of prior.
- Parameters
-
xmin lower limit of range to evaluate over xmax upper limit of range to evaluate over
- Returns
- integral of prior
Reimplemented in BCPositiveDefinitePrior, BCTH1Prior, BCSplitGaussianPrior, BCGaussianPrior, BCCauchyPrior, and BCConstantPrior.
Definition at line 81 of file BCPrior.cxx.
|
inlinevirtual |
Get kurtosis of prior.
If limits are infinite, use exact value from prior type
- Parameters
-
xmin lower limit of range to evaluate over xmax upper limit of range to evaluate over
- Returns
- kurtosis of prior distribution
Reimplemented in BCPositiveDefinitePrior.
|
inlinevirtual |
|
pure virtual |
Get log of prior.
- Parameters
-
x value to evaluate log of prior at
- Returns
- log of prior
Implemented in BCTH1Prior, BCPositiveDefinitePrior, BCTF1Prior, BCSplitGaussianPrior, BCTF1LogPrior, BCGaussianPrior, BCCauchyPrior, and BCConstantPrior.
|
inlinevirtual |
Get mean of prior.
If limits are infinite, use exact value from prior type
- Parameters
-
xmin lower limit of range to evaluate over xmax upper limit of range to evaluate over
- Returns
- mean of prior distribution
Reimplemented in BCPositiveDefinitePrior.
|
virtual |
Return mode of prior (in range).
- Parameters
-
xmin lower limit of range to evaluate over xmax upper limit of range to evaluate over
- Returns
- mode of prior in range.
Reimplemented in BCPositiveDefinitePrior, BCTH1Prior, BCTF1LogPrior, BCSplitGaussianPrior, BCConstantPrior, BCGaussianPrior, and BCCauchyPrior.
Definition at line 65 of file BCPrior.cxx.
|
virtual |
Get prior.
- Parameters
-
x value to evaluate prior at normalize Whether to normalize prior with stored integral
- Returns
- prior
Reimplemented in BCPositiveDefinitePrior, BCTH1Prior, and BCTF1Prior.
Definition at line 51 of file BCPrior.cxx.
|
virtual |
- Returns
- a random value distributed according to the prior.
- Parameters
-
xmin lower limit of range to generate value in xmax upper limit of range to generate value in R Pointer to the random generator to be used, if needed.
- Returns
- random value.
Reimplemented in BCPositiveDefinitePrior, BCTH1Prior, and BCConstantPrior.
Definition at line 126 of file BCPrior.cxx.
|
virtual |
Get raw moment of prior distrubion.
If limits are infinite, use exact value from prior type.
- Parameters
-
n moment number xmin lower limit of range to evaluate over xmax upper limit of range to evaluate over
- Returns
- raw moment of prior distribution
Reimplemented in BCPositiveDefinitePrior, BCTH1Prior, BCSplitGaussianPrior, BCGaussianPrior, BCCauchyPrior, and BCConstantPrior.
Definition at line 72 of file BCPrior.cxx.
|
inlinevirtual |
Get skewness of prior.
If limits are infinite, use exact value from prior type
- Parameters
-
xmin lower limit of range to evaluate over xmax upper limit of range to evaluate over
- Returns
- skewness of prior distribution
Reimplemented in BCPositiveDefinitePrior.
|
inlinevirtual |
Get standard deviation of prior.
If limits are infinite, use exact value from prior type
- Parameters
-
xmin lower limit of range to evaluate over xmax upper limit of range to evaluate over
- Returns
- standard deviation of prior distribution
Reimplemented in BCPositiveDefinitePrior, and BCTH1Prior.
|
virtual |
Get standardised moment of prior distrubion.
If limits are infinite, use exact value from prior type.
- Parameters
-
n moment number xmin lower limit of range to evaluate over xmax upper limit of range to evaluate over
- Returns
- standardised moment of prior distribution
Reimplemented in BCPositiveDefinitePrior, and BCTH1Prior.
Definition at line 112 of file BCPrior.cxx.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Get variance of prior.
If limits are infinite, use exact value from prior type
- Parameters
-
xmin lower limit of range to evaluate over xmax upper limit of range to evaluate over
- Returns
- variance of prior distribution
Reimplemented in BCPositiveDefinitePrior, and BCTH1Prior.
|
pure virtual |
- Returns
- Whether everything needed for prior is set and prior can be used.
Implemented in BCPositiveDefinitePrior, BCTH1Prior, BCConstantPrior, BCTF1LogPrior, BCSplitGaussianPrior, BCTF1Prior, BCGaussianPrior, and BCCauchyPrior.
|
virtual |
Set range of ROOT TF1 function.
Reimplemented in BCPositiveDefinitePrior, and BCTF1LogPrior.
Definition at line 133 of file BCPrior.cxx.
Member Data Documentation
|
protected |
The documentation for this class was generated from the following files:
- /root/bat/BAT/BCPrior.h
- /root/bat/src/BCPrior.cxx