Profile likelihood of a constrained model


I want to extract the profile likelihood of some parameter of a constrained model which is fitted using fitTo to a histogram containing my data. I also tried following the RooFit tutorial file profilell to get the profile likelihood of my variable.
However, unlike in the tutorial file, my profile likelihood (in red) is flat in the parameter’s allowed region, while the likelihood (blue) seems fine:

The model itself is containing RooFormulaVar as a function of my parameter of interest varKappa:

RooRealVar mrec("MRec", "MRec [GeV]", 120, 140);

   // COM smearing @ 240 GeV
RooRealVar COMmess("COMmess", "measured COM energy", 235., 245.);
RooGaussian COMsmear("COMsmear", "COM smearing", COMmess, RooConst(240.), RooConst(0.28));
RooFormulaVar varCOM("varCOM", "COMmess - 240.", COMmess);

   // mH smearing @ 240 GeV
RooRealVar mHmess("mHmess", "measured Higgs mass", 125., 124, 126);
RooGaussian mHsmear("mHsmear", "Higgs mass smearing", mHmess, RooConst(125.), RooConst(0.056));

   // Fit a Crystalball pdf to the data
RooFormulaVar mean("mean", "mHmess + varCOM", RooArgSet(mHmess, varCOM));
RooRealVar sigma("sigma", "sigma", 0.2, 0.001, 2);
RooRealVar alphaL("alphaL", "alphaL", 1., 0.1, 10);
RooRealVar alphaR("alphaR", "alphaR", 1., 0.1, 6);
RooRealVar NL("NL", "NL", 4.6, 0.1, 10); //4.6, 0.1, 20
RooRealVar NR("NR", "NR", 0.5, 0.1, 5.);

RooCrystalBall sig("sig", "Signal", mrec, mean, sigma, alphaL, NL, alphaR, NR);

   // Fit an exponential to the data
RooRealVar tau("tau", "tau", -0.01, -0.5, 0.);
RooExponential bkg("bkg", "Background", mrec, tau);

   // Luminosity smearing @ 240 GeV
RooRealVar Lmess("Lmess", "Luminosity measured", 4e+06, 6e+06);
RooGaussian Lsmear("Lsmear", "Luminosity smearing", Lmess, RooConst(5e+06), RooConst(5e+05));
RooFormulaVar varL("varL", "(Lmess - 5e+06) / 5e+06", Lmess);

   // Efficiency smearing @ 240 GeV
RooRealVar Emess("Emess", "Efficiency_mess", 0.2, 0.8);
RooGaussian Esmear("Esmear", "Efficiency smearing", Emess, RooConst(0.464897), RooConst(0.0464897));
RooFormulaVar varE("varE", "(Emess - 0.464897) / 0.464897", Emess);

   // BR smearing @ 240 GeV
RooRealVar BRmess("BRmess", "BR_mess", 1., 0.99, 1.01);
RooGaussian BRsmear("BRsmear", "BR smearing", BRmess, RooConst(1.), RooConst(0.5));
RooFormulaVar varBR("varBR", "(BRmess - 1.) / 1.", BRmess);

   // Kappa Lambda @ 240 GeV
RooRealVar varKappaideal("varKappaideal", "Kappa_ideal", 0., -10, 15.);
RooRealVar varKappa("varKappa", "kappa variation", 0., -5, 25.);
RooRealVar varKappaHZZ("varKappaHZZ", "kappa HZZ variation", 0.);
RooGaussian varKappasmear("varKappasmear", "varKappa smearing", varKappa, varKappaideal, RooConst(1e-02));

   // NLO CS @ 240 GeV
RooConstVar CSLO("CSLO", "CS_LO", 0.0067643);
RooConstVar C1("C1", "C1", 0.015);
RooConstVar dZh("dZh", "deltanZh parameter", -0.00154);
RooRealVar CSHZTrue("CSHZTrue", "CS HZ true", 1., 0., 2.);
RooFormulaVar CSNLO("CSNLO", "((1 + varKappaHZZ) * (1 + varKappaHZZ) * CSLO * (1 + (C1 * (varKappa + 1)))) / (1 - (dZh * ((varKappa + 1) * (varKappa + 1))))", RooArgSet(varKappaHZZ, CSLO, C1, dZh, varKappa));

   // Sum the composite signal and background into an extended pdf nsig*sig+nbkg*bkg
RooRealVar nsigTrue("nsigTrue", "number of MC signal events", nsigMC);
RooRealVar nbkg("nbkg", "number of background events", nbkgMC);

RooFormulaVar muZHsig("muZHsig", "CSNLO * (1. * (1 + varBR)) * 0.464897 * (1 + varE) * 5e+06 * (1 + varL) * CSHZTrue", RooArgSet(CSNLO, varBR, CSHZTrue, varE, varL));
RooAddPdf modelBare("modelBare", "(g1+g2)+a", RooArgList(bkg, sig), RooArgList(nbkg, muZHsig));

  // PDF with the constraints
RooProdPdf model("model", "Final model", RooArgSet(modelBare, Lsmear, Esmear, mHsmear, COMsmear, BRsmear, varKappasmear));

 // Import histogram
RooDataHist dh("dh", "dh", mrec, Import(*hh));

 // Build the NLL and do the minimization using minuit2
RooAbsReal *nll = model.createNLL(dh, Extended(kTRUE), Constrain(RooArgSet(mHmess, BRmess, Lmess, COMmess, Emess)), Offset(kTRUE));
RooMinimizer minim(*nll);

RooPlot *frame1 = varKappa.frame(Range(-5, 15.), Title("profileLL in #kappa"));
nll->plotOn(frame1, ShiftToZero());
RooAbsReal *pll_varKappa = nll->createProfile(varKappa);
pll_varKappa->plotOn(frame1, LineColor(kRed));
TCanvas *d = new TCanvas("rf605_profilell", "rf605_profilell", 800, 400);

Even if I change the parameters and their limits, the Profile likelihood stays flat. If I zoom, I see that the profile likelihood is changing rapidly:

Is this behavior due to the choice of the model (and/or due to the way of constructing it in RooFit) or could this be because of some badly chosen parameter?

Thank you very much for your help! :slight_smile:


No ideas, what could be the cause? :pleading_face:


It looks to me the s an issue in performing the minimisations when computing the profile likelihood. To understand better the problem, I would need to be able to run your script, I would need your input histogram and parameters


Hi Lorenzo,

Thank you very much for looking into this! Here you can find the Histograms and the script:


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.