SpeysideHEP/spey

SL issue

WolfgangWaltenberger opened this issue · 4 comments

System Settings

Describe the bug

Here is a weird case, something is wrong. I observe 40,000 events, I expected 40,000. My background uncertainty is 1000. I expected a 95% poi_upper limit of about 1.96 * sqrt ( 40000 + 1000**2 ) = 2000.
Instead I get 384, which seems to be approximately 1.96 * sqrt ( 40000 ). The background uncertainty doesnt even
seem to enter.

To Reproduce

from spey import get_uncorrelated_nbin_statistical_model, ExpectationType
statModel = get_uncorrelated_nbin_statistical_model(
data = [ 40000. ],
backgrounds = [ 40000. ],
background_uncertainty = [ 1000. ],
signal_yields = [1],
xsection = 1,
analysis = "x",
backend = 'simplified_likelihoods'
)

muhat = statModel.poi_upper_limit ( expected = ExpectationType.observed )
print ( "muhat", muhat )

Expected behaviour

No response

Additional information

No response

Could it be that we arent profiling in each step of likelihood evaluations?

Ah a good benchmark apart from my very simple (but correct) argument is, look at
https://atlas.web.cern.ch/Atlas/GROUPS/PHYSICS/PAPERS/SUSY-2018-22/tab_12.png
try to reproduce the first column, nobs=2111.

Hi @WolfgangWaltenberger, 40000 is rather large. Have you tried to change the bounds?

ah right, i kept forgetting that the bounds are set to low values. sorry, my bad.
I guess I change the question to a question of whether the user should get some feedback in case the fits
run into the bounds.