BCSplitGaussianPrior.cxx
40 return -0.5 * (x - fMode) * (x - fMode) / fSigmaAbove / fSigmaAbove + 0.5 * log(2 / M_PI) - log(fSigmaAbove + fSigmaBelow);
41 return -0.5 * (x - fMode) * (x - fMode) / fSigmaBelow / fSigmaBelow + 0.5 * log(2 / M_PI) - log(fSigmaAbove + fSigmaBelow);
62 // return fMode * fMode + (pow(fSigmaBelow, 3) + pow(fSigmaAbove, 3) + 2 * fMode * sqrt(2 / M_PI) * (pow(fSigmaAbove, 2) - pow(fSigmaBelow, 2))) / (fSigmaBelow + fSigmaAbove);
68 double erf_min = (r == BCAux::kNegativeInfiniteRange) ? -1 : TMath::Erf((xmin - fMode) / smin / sqrt(2));
69 double erf_max = (r == BCAux::kPositiveInfiniteRange) ? +1 : TMath::Erf((xmax - fMode) / smax / sqrt(2));
71 double phi_min = (r == BCAux::kNegativeInfiniteRange) ? 0 : exp(-0.5 * (xmin - fMode) * (xmin - fMode) / smin / smin);
72 double phi_max = (r == BCAux::kPositiveInfiniteRange) ? 0 : exp(-0.5 * (xmax - fMode) * (xmax - fMode) / smax / smax);
77 double Ex = fMode + sqrt(2 / M_PI) * (smax * smax * (1 - phi_max) - smin * smin * (1 - phi_min)) / I;
82 phi_min *= (r == BCAux::kInfiniteRange or r == BCAux::kNegativeInfiniteRange) ? 0 : sqrt(2 / M_PI) * (xmin - fMode) / smin;
83 phi_max *= (r == BCAux::kInfiniteRange or r == BCAux::kPositiveInfiniteRange) ? 0 : sqrt(2 / M_PI) * (xmax - fMode) / smax;
86 double Ex2 = 2 * fMode * Ex - fMode * fMode + (smax * smax * smax * (erf_max - phi_max) - smin * smin * smin * (erf_min - phi_min)) / I;
108 double erf_min = (r == BCAux::kNegativeInfiniteRange) ? -1 : TMath::Erf((xmin - fMode) / smin / sqrt(2));
109 double erf_max = (r == BCAux::kPositiveInfiniteRange) ? +1 : TMath::Erf((xmax - fMode) / smax / sqrt(2));
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.
Definition: BCSplitGaussianPrior.cxx:45
virtual double GetIntegral(double xmin=-std::numeric_limits< double >::infinity(), double xmax=std::numeric_limits< double >::infinity())
Get integral of prior.
Definition: BCSplitGaussianPrior.cxx:92
A class to represent a split-Gaussian prior of a parameter.
Definition: BCSplitGaussianPrior.h:32
BCAux::BCRange RangeType(double xmin, double xmax)
Return type of range as a BCAux::BCRange enum.
Definition: BCAux.cxx:85
lower < upper, lower limit finite, upper limit infinite
Definition: BCAux.h:91
lower < upper, lower limit infinite, upper limit finite
Definition: BCAux.h:90
BCSplitGaussianPrior(double mode, double sigma_below, double sigma_above)
Constructor.
Definition: BCSplitGaussianPrior.cxx:19
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.
Definition: BCPrior.cxx:72