BernsteinCorrection is a utility in RooStats to augment a nominal PDF with a polynomial correction term.
This is useful for incorporating systematic variations to the nominal PDF. The Bernstein basis polynomials are particularly appropriate because they are positive definite.
This tool was inspired by the work of Glen Cowan together with Stephan Horner, Sascha Caron, Eilam Gross, and others. The initial implementation is independent work. The major step forward in the approach was to provide a well defined algorithm that specifies the order of polynomial to be included in the correction. This is an empirical algorithm, so in addition to the nominal model it needs either a real data set or a simulated one. In the early work, the nominal model was taken to be a histogram from Monte Carlo simulations, but in this implementation it is generalized to an arbitrary PDF (which includes a RooHistPdf). The algorithm basically consists of a hypothesis test of an nthorder correction (null) against a n+1th order correction (alternate). The quantity q = 2 log LR is used to determine whether the n+1th order correction is a major improvement to the nth order correction. The distribution of q is expected to be roughly \(\chi^2\) with one degree of freedom if the nth order correction is a good model for the data. Thus, one only moves to the n+1th order correction of q is relatively large. The chance that one moves from the nth to the n+1th order correction when the nth order correction (eg. a type 1 error) is sufficient is given by the Prob( \(\chi^2_1\) > threshold). The constructor of this class allows you to directly set this tolerance (in terms of probability that the n+1th term is added unnecessarily).
To do: Add another method to the utility that will make the sampling distribution for 2 log lambda for various m vs. m+1 order corrections using a nominal model and perhaps having two ways of generating the toys (either via a histogram or via an independent model that is supposed to reflect reality). That will allow one to make plots like Glen has at the end of his DRAFT very easily.
Definition at line 22 of file BernsteinCorrection.h.
Public Member Functions  
BernsteinCorrection (double tolerance=0.05)  
virtual  ~BernsteinCorrection () 
void  CreateQSamplingDist (RooWorkspace *wks, const char *nominalName, const char *varName, const char *dataName, TH1F *, TH1F *, Int_t degree, Int_t nToys=500) 
Create sampling distribution for q given degree1 vs. degree corrections. More...  
Int_t  ImportCorrectedPdf (RooWorkspace *, const char *, const char *, const char *) 
Main method for Bernstein correction. More...  
virtual TClass *  IsA () const 
void  SetMaxCorrection (double maxCorr) 
void  SetMaxDegree (Int_t maxDegree) 
virtual void  Streamer (TBuffer &) 
void  StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) 
Static Public Member Functions  
static TClass *  Class () 
static const char *  Class_Name () 
static constexpr Version_t  Class_Version () 
static const char *  DeclFileName () 
Private Attributes  
double  fMaxCorrection 
maximum correction factor at any point (default is 100) More...  
Int_t  fMaxDegree 
maximum polynomial degree correction (default is 10) More...  
double  fTolerance 
probability to add an unnecessary term More...  
#include <RooStats/BernsteinCorrection.h>
BernsteinCorrection::BernsteinCorrection  (  double  tolerance = 0.05  ) 
Definition at line 79 of file BernsteinCorrection.cxx.

inlinevirtual 
Definition at line 26 of file BernsteinCorrection.h.

static 

inlinestaticconstexpr 
Definition at line 47 of file BernsteinCorrection.h.
void BernsteinCorrection::CreateQSamplingDist  (  RooWorkspace *  wks, 
const char *  nominalName,  
const char *  varName,  
const char *  dataName,  
TH1F *  samplingDist,  
TH1F *  samplingDistExtra,  
Int_t  degree,  
Int_t  nToys = 500 

) 
Create sampling distribution for q given degree1 vs. degree corrections.
Definition at line 203 of file BernsteinCorrection.cxx.

inlinestatic 
Definition at line 47 of file BernsteinCorrection.h.
Int_t BernsteinCorrection::ImportCorrectedPdf  (  RooWorkspace *  wks, 
const char *  nominalName,  
const char *  varName,  
const char *  dataName  
) 
Main method for Bernstein correction.
Definition at line 87 of file BernsteinCorrection.cxx.

inlinevirtual 
Definition at line 47 of file BernsteinCorrection.h.

inline 
Definition at line 29 of file BernsteinCorrection.h.

inline 
Definition at line 30 of file BernsteinCorrection.h.

virtual 

inline 
Definition at line 47 of file BernsteinCorrection.h.

private 
maximum correction factor at any point (default is 100)
Definition at line 42 of file BernsteinCorrection.h.

private 
maximum polynomial degree correction (default is 10)
Definition at line 41 of file BernsteinCorrection.h.

private 
probability to add an unnecessary term
Definition at line 43 of file BernsteinCorrection.h.