nll scan of POI and nuisance parameters #1889
-
Can you please tell me how to obtain the plot of nll as a function of model parameters (POI and nuisance parameters)? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @diptaparna, you can get (twice the) NLL returned from a fit via the
import pyhf
import cabinetry
model = pyhf.simplemodels.correlated_background(
signal=[12.0, 11.0],
bkg=[50.0, 52.0],
bkg_up=[45.0, 57.0],
bkg_down=[55.0, 47.0],
)
data = [67, 58] + model.config.auxdata
scan_results = cabinetry.fit.scan(model, data, "mu")
cabinetry.visualize.scan(scan_results) which will create the figure You can find the current |
Beta Was this translation helpful? Give feedback.
Hi @diptaparna, you can get (twice the) NLL returned from a fit via the
return_fitted_val
keyword argument inpyhf.infer.mle.fit
. Performing a scan means setting the parameter over which you are scanning to constant (via thefixed_params
argument) and to the specific value you are interested in for the scan (via theinit_pars
argument). You then repeat that procedure for various parameter values and can then plot the NLL vs the values at which you held the respective parameter fixed.cabinetry
provides you an API for (currently only one-dimensional) likelihood scans:cabinetry.fit.scan
, which returns you an object that you can feed tocabinetry.visualize.scan
for visualization purposes. A…