-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Toys giving mysterious results #1161
Comments
hm I wonder whether there is an issue with the way the bands are computed or plotted .. I mean certainly the ordering of the percentiles is not being observed. (why is the green band not in the yellow?!) (note to us: this could be a useful check to do before returning to the user, but I don't really see how this could ever happen.. but apparently it does) I'd suggest to focus on a single µ value first . just dumping sth here clearly the s.pvalue at 1.5 should be smaller than the b.pvalue, so I'm looking at that. the nominal expected / observered look ok. That there is a discreteness to the test statistics is normal since they corresspond to indiividual counts and become noticable in the low stats regime. |
I think the culprit might be the test statistic value at 5. which is a delta peak (the other peaks have more internal structure so the pvalues are morer behaved) as kate points: mu hunch is that there are slight numeric differences in the values associated with "zero" observed events. But since we create the "expected test statistics" from the bkg only sample, the positions from which we take the p-value are tuned to the b-only distribution, while the s+b distribution has undefined behavior towards those diffeernces rounding to 6 decimal places in the test stat
seems to reinstate the true order of CLs values edit: or rather its's probably enough to round the test stat cut values |
@kpachal : I just looked in more detail at your wspace. Your bkg ssystematic is configured such that the -1 and +1 settings both poinit downwards. Is this intended? |
Hi Lukas, Oh - no, definitely not intentional!! I was trying to use this asymmetric uncertainty because having a single component with size 0.2 was causing crashes, so I thought that splitting it up and making it never negative would fix things. But I guess it's implemented wrong? What about it means they both point downwards? |
the way it's in your workspace you have
which translates to:
i.e. the up/dn values in the spec are multiplicative leading to both values being smaller than the nominal val. This doesn't solve your issue yet, but I wanted to point this out. |
Ooooh ok thank you very much! That makes it weirder that it was crashing with a single uncertainty of size 0.2 🤨 but will definitely investigate |
Hi Lukas, thanks a lot! I did give it a shot yesterday with that branch and the results unfortunately still look strange to me. I then tested the exact same code you use in #1162 (as far as I can tell without a direct copy/paste) and don't get the same plot you show. I got this: with this code:
I'm pretty sure the branch installed correctly, but it is then a little weird that I don't get the same thing you do with it. I'll keep poking at it. |
Hi @lukasheinrich , just to confirm, I checked that I did indeed pick up the changes from the |
this should now be definitively fixed by #1162 |
Thank you very much @lukasheinrich !! I'll be testing it today, very excited for it 😄 |
hi @kpachal can you scan towards higher µ (given that the uncertainties are higher the upper limit/0.05 crossing opint will be weaker) .. maybe upp to µ=5. That the values saturate all the way to CLs=1 has ssomething to do w/ #1160 #892 see e.g. plot at the bottom of where the green band ssaturates up to µ=0.5 or so #892 (comment) |
the poissonian constraint of
for 50% uncert. But in this regime the interaction between constraint terms and the main likelihood become tricky because adding a 100% in this manner would mean that 15% of the time you predict a signal yield of 0 and so a scenario indistinguishablel from b-only is only a 1-sigma pull away. I'm sure the stat committee has some recommendation here (or previous analyses) FWIW this is my plot with normssys and 50% uncert on signall and 10% on bkg notice the cell where the expected data for -1,0,+1 settings of the signal uncert is shown (2.1,4.1,6.1) for bkg=0.1 and signall 4+/-2 note also that I have a 1% lumi uncertainty
|
Hi Lukas, Thanks for the tip on the uncertainty format! I'll dig around and see if I can find a stat forum recommendation for how to handle 100% uncertainties. Cheers, |
Hi pyhf friends!
I'm playing with the newly supported toys in pyhf v0.5.4.dev3 - thank you so much for introducing them. I'm doing a mu scan to obtain an upper limit in a single bin region with 0 observed events. An example script is given at the bottom.
If I run my scan using asymptotics (see line 51 of the script),
val = pyhf.infer.hypotest(mu_seed[0], data, model, qtilde=True, return_expected_set=True,return_tail_probs=True)
I get this plot of the result:
Which, other than being a better-than-zero result, is fine. If I run using toys (line 53 of the script),
val = pyhf.infer.hypotest(mu_seed[0], data, model, calctype='toybased', ntoys=int(sys.argv[1]),return_expected_set=True,return_tail_probs=True)
I get this output instead:
Which ...... yeah. 😬
I had a poke around to see what might be going on and the underlying s-plus-b and b-only distributions look super weird. For that run of toys (10k), here's the two distributions, with the CLb and CLs+b values that were calculated from them, for one tested mu value of 0.552:
There's a ton of repetition of the exact same values and what looks like some kind of default upper value in the b-only distribution, but what it is changes with mu.
Any idea what might be going on here? I've filed this as a bug but it could also be that I'm just using this wrong.
Many thanks for your help, and again for adding the toys!
Cheers,
Kate
==================
Example script:
The text was updated successfully, but these errors were encountered: