61 void IntervalExamples()
74 wspace->
factory(
"Gaussian::normal(x[-10,10],mu[-1,1],sigma[1])");
81 modelConfig->
SetPdf( *wspace->
pdf(
"normal") );
94 double confidenceLevel = 0.95;
98 plc.SetConfidenceLevel( confidenceLevel);
103 fc.SetConfidenceLevel( confidenceLevel);
105 fc.UseAdaptiveSampling(
true);
109 fc.FluctuateNumDataEntries(
false);
122 wspace->
factory(
"Uniform::prior(mu)");
127 bc.SetConfidenceLevel( confidenceLevel);
132 mc.SetConfidenceLevel( confidenceLevel);
135 mc.SetNumBurnInSteps(500);
136 mc.SetNumIters(100000);
137 mc.SetLeftSideTailFraction(0.5);
141 double expectedLL = data->
mean(*x)
144 double expectedUL = data->
mean(*x)
149 std::cout <<
"expected interval is [" <<
150 expectedLL <<
", " <<
151 expectedUL <<
"]" << endl;
153 cout <<
"plc interval is [" <<
157 std::cout <<
"fc interval is ["<<
161 cout <<
"bc interval is [" <<
165 cout <<
"mc interval is [" <<
170 cout <<
"is mu=0 in the interval? " <<
210 RooPlot * bcPlot = bc.GetPosteriorPlot();
double normal_quantile(double z, double sigma)
Inverse ( ) of the cumulative distribution function of the lower tail of the normal (Gaussian) distri...
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Plot dataset on specified frame.
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
This class provides simple and straightforward utilities to plot a MCMCInterval object.
void SetStatColor(Color_t color=19)
void Print(Option_t *option="") const
Print the real and cpu time passed between the start and stop events.
LikelihoodInterval is a concrete implementation of the RooStats::ConfInterval interface.
virtual void SetWorkspace(RooWorkspace &ws)
double normal_quantile_c(double z, double sigma)
Inverse ( ) of the cumulative distribution function of the upper tail of the normal (Gaussian) distri...
R__EXTERN TStyle * gStyle
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
This class provides simple and straightforward utilities to plot a LikelihoodInterval object...
ProfileLikelihoodCalculator is a concrete implementation of CombinedCalculator (the interface class f...
void Draw(const Option_t *options=NULL)
virtual void SetObservables(const RooArgSet &set)
specify the observables
Double_t LowerLimit(const RooRealVar ¶m)
return the lower bound of the interval on a given parameter
void SetCanvasColor(Color_t color=19)
static struct mg_connection * fc(struct mg_context *ctx)
void Stop()
Stop the stopwatch.
void SetFrameFillColor(Color_t color=1)
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
virtual void SetPdf(const RooAbsPdf &pdf)
Set the Pdf, add to the the workspace if not already there.
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
virtual Double_t LowerLimit()
virtual Bool_t IsInInterval(const RooArgSet &) const
check if given point is in the interval
RooRealVar represents a fundamental (non-derived) real valued object.
virtual void setVal(Double_t value)
Set value of variable to 'value'.
Double_t LowerLimit(RooRealVar ¶m)
return lower limit on a given parameter
Double_t UpperLimit(const RooRealVar ¶m)
return the upper bound of the interval on a given parameter
void SetPadBorderMode(Int_t mode=1)
void SetCanvasBorderMode(Int_t mode=1)
void SetPadColor(Color_t color=19)
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual RooPlot * statOn(RooPlot *frame, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none())
Add a box with statistics information to the specified frame.
Bool_t defineSet(const char *name, const RooArgSet &aset, Bool_t importMissing=kFALSE)
Define a named RooArgSet with given constituents.
Double_t mean(RooRealVar &var, const char *cutSpec=0, const char *cutRange=0) const
void SetLineColor(Color_t color)
void SetLineWidth(Int_t width)
virtual Double_t UpperLimit(RooRealVar ¶m)
get the highest value of param that is within the confidence interval
RooDataSet is a container class to hold unbinned data.
RooPlot * frame(const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Double_t UpperLimit(RooRealVar ¶m)
return upper limit on a given parameter
A RooPlot is a plot frame and a container for graphics objects within that frame. ...
The FeldmanCousins class (like the Feldman-Cousins technique) is essentially a specific configuration...
Namespace for the RooStats classes.
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
PointSetInterval is a concrete implementation of the ConfInterval interface.
RooAbsPdf * pdf(const char *name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
virtual Double_t LowerLimit(RooRealVar ¶m)
get the lowest value of param that is within the confidence interval
virtual void SetPriorPdf(const RooAbsPdf &pdf)
Set the Prior Pdf, add to the the workspace if not already there.
RooRealVar * var(const char *name) const
Retrieve real-valued variable (RooRealVar) with given name. A null pointer is returned if not found...
RooFactoryWSTool & factory()
Return instance to factory tool.
virtual Double_t UpperLimit()
SimpleInterval is a concrete implementation of the ConfInterval interface.
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
void SetTitleFillColor(Color_t color=1)
RooDataSet * generate(const RooArgSet &whatVars, Int_t nEvents, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none())
Generate a new dataset containing the specified variables with events sampled from our distribution...
const RooArgSet * set(const char *name)
Return pointer to previously defined named set with given nmame If no such set is found a null pointe...
virtual void SetParametersOfInterest(const RooArgSet &set)
MCMCInterval is a concrete implementation of the RooStats::ConfInterval interface.
virtual void Update()
Update canvas pad buffers.
Bayesian Calculator estimating an interval or a credible region using the Markov-Chain Monte Carlo me...
BayesianCalculator is a concrete implementation of IntervalCalculator, providing the computation of a...
The RooWorkspace is a persistable container for RooFit projects.
virtual Int_t numEntries() const
virtual void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.