How to draw toy MC? #2235
-
Dear experts, Could you please assist me in understanding how to use pyhf for drawing toy Monte Carlo (MC) samples? I came across the following code snippet, which seems to draw toys from the template model:
Thank you for your support! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If the question is about how to throw toys using If you're asking about how to do it yourself, look here: pyhf/src/pyhf/infer/calculators.py Lines 756 to 779 in c096b33 suggested_init ). At that point, we just sample as you typically expect from the "scipy API" in the same way.
|
Beta Was this translation helpful? Give feedback.
The key thing missing in your example @zjkjsd are the fluctuations of auxiliary data ("global observables"). For nuisance parameters with Gaussian constraints, the corresponding auxiliary data is drawn from Gaussians (that's where the Gaussian in @kratsg's 1. appears). If you look at the output of
pyhf
's implementation, you will see that both the counts per bin and the auxiliary data fluctuate.