 
  
 
 Bayesian calculator: basic example 
  
 
Bayesian Result using a Flat prior 
0.9% CL central interval: [ 0.50606 - 6.89326 ] or 0.95% CL limits
 
Bayesian Result using a 1/sqrt(s) prior  
0.9% CL central interval: [ 0.0746294 - 5.85425 ] or 0.95% CL limits
 
 
 
 
void confLevel = 0.90)
{
 
   w->factory(
"SUM::pdf(s[0.001,15]*Uniform(x[0,1]),b[1,0,2]*Uniform(x))");
 
   w->factory(
"Gaussian::prior_b(b,1,1)");
 
   w->factory(
"PROD::model(pdf,prior_b)");
 
 
 
   
   data.add({*(
w->var(
"x"))}, 
w->var(
"n")->getVal());
 
 
   
 
   
 
   std::cout << "\nBayesian Result using a Flat prior " << std::endl;
   double cl = 
bcalc.ConfidenceLevel();
 
   std::cout << cl << 
"% CL central interval: [ " << 
interval->LowerLimit() << 
" - " << 
interval->UpperLimit()
             << " ] or " << cl + (1. - cl) / 2 << "% CL limits\n";
 
   std::cout << "\nBayesian Result using a 1/sqrt(s) prior  " << std::endl;
   cl = 
bcalc2.ConfidenceLevel();
   std::cout << cl << 
"% CL central interval: [ " << 
interval2->LowerLimit() << 
" - " << 
interval2->UpperLimit()
             << " ] or " << cl + (1. - cl) / 2 << "% CL limits\n";
 
 
   
   
}
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter char TVirtualGLPainter plot
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Abstract interface for all probability density functions.
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Container class to hold unbinned data.
static RooMsgService & instance()
Return reference to singleton instance.
Plot frame and a container for graphics objects within that frame.
BayesianCalculator is a concrete implementation of IntervalCalculator, providing the computation of a...
SimpleInterval is a concrete implementation of the ConfInterval interface.
Persistable container for RooFit projects.
RooCmdArg WeightVar(const char *name="weight", bool reinterpretAsWeight=false)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Namespace for the RooStats classes.
- Author
- Gregory Schott 
Definition in file rs701_BayesianCalculator.C.