I am trying to fit a PDF to data using RooFit to extract the PDF parameters (8 parameters). When I run the fit on toy data (Left-Plot), it works properly, but when I use the real data (2 inputs :x, costheta), the fit is not good (Right-Plot), as shown by the plots below. I’m not quite sure what the issue could be. Could it be related to parameter adjustments? I don’t know the physical values of each of these parameters.
just looking at the formulae in your file, it is hard to follow how the PDF is supposed to look like. It certainly doesn’t seem to follow the data with the current values of the parameters.
What does the fitter say about this PDF? Could it be that the parameters have strong correlations (i.e. moving one can be compensated by moving another)?
It could also be that the straight line we see is a region that the fitter has trouble coming out of. It would suggest to make the PDF as simple as possible, and look for starting values that roughly follow the data. Then you fit and see where it goes. You can add complexity to the PDF later once you know good starting values.
for the output of the fitter is like this
Minuit2Minimizer : Valid minimum - status = 0
FVAL = 88344.7639211591886
Edm = 0.000152453542378743086
Nfcn = 891
gamma1 = -0.9 +/- 0.00202508 (limited)
gamma2 = -0.5 +/- 0.00362778 (limited)
gamma3 = -0.9 +/- 0.000592726 (limited)
gamma4 = 0.563283 +/- 0.00604722 (limited)
gamma5 = -0.5 +/- 0.000338502 (limited)
gamma6 = -0.5 +/- 0.000302322 (limited)
gamma7 = -0.5 +/- 0.000203322 (limited)
gamma8 = 4 +/- 0.00069419 (limited)
Info in : Minuit2Minimizer::Hesse Using max-calls 4000
Info in : Minuit2Minimizer::Hesse Hesse is valid - matrix is accurate
[#1] INFO:Minimization – RooAbsMinimizerFcn::setOptimizeConst: deactivating const optimization
[#1] INFO:Plotting – RooAbsReal::plotOn(GenPdf) plot on x integrates over variables (costheta)
[#1] INFO:NumericIntegration – RooRealIntegral::init(GenPdf_Int[costheta,x]) using numeric integrator RooAdaptiveIntegratorND to calculate Int(x,costheta)
[#1] INFO:NumericIntegration – RooRealIntegral::init(GenPdf_Int[costheta]_Norm[costheta,x]) using numeric integrator RooIntegrator1D to calculate Int(costheta)
[#1] INFO:Plotting – RooAbsReal::plotOn(GenPdf) plot on costheta integrates over variables (x)
[#1] INFO:NumericIntegration – RooRealIntegral::init(GenPdf_Int_Norm[costheta,x]) using numeric integrator RooIntegrator1D to calculate Int(x)
By trying to inspect the PDF and considering, for example, 1 or 2 parameters, the fit on the costheta variable changes,
but for the x variable, there is no effect. Essentially, my likelihood depends on x and costheta,
so all the functions depend on both x and costheta. However, in the functions, costheta is explicitly defined, in contrast to x.
Therefore, I am wondering whether this is the reason why the fit on x remains unchanged.