Negative values of PDF (not reflected in the fitted plot)

Hi,

I am fitting a distribution using a simple polynomial function of order 1 using RooPolynomial.
It is not such a good description of the distribution, but I am using it for simplicity to understand some errors.

The way I fit is:

fFitResult = fFitUnbin->fitTo(*data, RooFit::PrintLevel(-1), RooFit::Range(xmin, xmax), RooFit::NumCPU(4), RooFit::SumW2Error(kTRUE), RooFit::Save(true) );

where fFitUnbin is a RooExtendedPdf.

Please find the fit attached and the errors below:

[#1] INFO:Eval -- RooRealVar::setRange(x) new range named 'our_window' created with bounds [110,170] [#0] ERROR:Eval -- RooAbsReal::logEvalError(Polynomial) evaluation error, origin : RooPolynomial::Polynomial[ x=x coefList=(coef1) ] message : p.d.f normalization integral is zero or negative server values: x=x=110.5, coefList=(coef1 = -0.00815491) [#0] ERROR:Eval -- RooAbsReal::logEvalError(Polynomial) evaluation error, origin : RooPolynomial::Polynomial[ x=x coefList=(coef1) ] message : p.d.f normalization integral is zero or negative server values: x=x=111.5, coefList=(coef1 = -0.00815491) [#0] ERROR:Eval -- RooAbsReal::logEvalError(Polynomial) evaluation error, origin : RooPolynomial::Polynomial[ x=x coefList=(coef1) ] message : p.d.f normalization integral is zero or negative server values: x=x=112.5, coefList=(coef1 = -0.00815491) [#0] ERROR:Eval -- RooAbsReal::logEvalError(Polynomial) evaluation error,

And this is the not whole error. It complaints about this at many x values.

but from the plot I do not see anywhere pdf going negative.

Do you have an idea why do I get such errors if hte plot does not show any negative or 0 values
of pdf?

Any help will be appreciated.

Thanks in advance,
Shilpi


Hi,
I guess the error is produced during the fit, when the parameters of the polynomial are changed and it becomes negative.
If you want to avoid these errors, you can use the RooBernstein , which is the PDF based on the Bernstein polynomials, which are by definition always positive.

Best Regards

Lorenzo

Hi Lorenzo,

Thanks for the reply. I increased the fit range and now using the function
which describes it better: Gaussian convoluted with the Bernstein polynomials
and I dont see this problem while fitting atleast.

But I have another problem now: I see large error bands on the fit.
Please find the plot attached. I use 4th order Bernstein polynomials.
I see that the error on the Bernstein polynomials is quite large.
Here are the fitted parameters:

====================================================
Floating Parameter FinalValue +/- Error


             coef1    3.7435e+01 +/-  2.90e+01
             coef2    4.4663e+00 +/-  6.86e+00
             coef3    4.7974e-03 +/-  4.64e+01
             coef4    1.0762e+01 +/-  1.55e+01
              mean    6.1612e+00 +/-  1.18e+00
              norm    6.2498e+02 +/-  2.42e+01
             sigma    3.1995e+00 +/-  5.59e-01
           stepval    9.9092e+01 +/-  1.19e+00

==============================================================

I give the parameter range as follows:

==================================================================
RooRealVar mean(“mean”, “mean”, 10, -100, 100);
RooRealVar sigma(“sigma”, “sigma”, 3, 1, 50);
RooRealVar stepval(“stepval”, “Stepval-”,100, 30, 400);

for(int ipol=1; ipol<=poldeg; ipol++){

 pol[ipol] = new RooRealVar(TString::Format("coef%d",ipol), TString::Format("coef%d",ipol), 6, 0,50);

}

I tried changing the parameter range and the initial values but none of them helped.
Are there any suggestions to take care of this?

Any suggestions would be helpful.

Thanks,
Shilpi