# Access nuisance parameters values from toys

Dear experts,

I’m using RooStats tools to calculate upper limits, using both Frequentist and Hybrid approach.
Does an easy way exist to access (or to store) the values of sampled nuisance parameters for each toy (/for each value of test statistics)?
In principle the best solution could be to access them from HypoTestInverterResult; if it cannot be done, could you suggest other ways to do that?

Thank you.

Michele.

Hi,

Using the Detailed output option of the test statistics classes, EnableDetailedOutput(true), the HypoTestResult class should contain for each toy a detailed information on the fit performed. The information should contain also the fitted nuisance parameter values.
If you need to have also the sampled value used in the Hybrid case, you might need to customize the detailed output. You can do this by re-implementing a test statistic class.

Best Regards

Lorenzo

Hi,

I have just another question about toys in Frequentis Calculator.
Suppose that in a counting experiment your expected number of events depends on a set on nuisance.
When you generate “pseudo observed” data toys and you sample your observable for each toy (number of events), how should you compute your expectation (for instance, your expected number of events in case of poissonian distribution)?
Should you calculate it starting from the nuisance parameter values (which are fit at the beginning, the same - i guess - used to sample global observable), or should you use your “original” model parameters?

Thank you.

Michele.

Hi Michele,

In the case of the FrequentistCalculator, you use for the nuisance parameter values for each toy (observables and global observables) the best fitted values conditioned at the parameter of interest value you are testing.
So, if your number of expected events will use that nuisance parameter fitted value.
All this is done if you are using the FrequentistCalculator

Best Regards

Lorenzo

Hi Lorenzo,
I am very interested in this exchange, but I didn’t understand the answer you gave to Michele. In the frequentist approach, for a simple case of a counting experiment in one bin, how are pseudo-observations drawn toy by toy ? Are they drawn from a Poisson with mean equal to the expected counts corresponding to the best-fitted values for the nuisance parameters conditioned at the parameter of interest value I am testing ? Or are they drawn from a Poisson with mean equal to the expected counts corresponding to the central values of the nuisance parameters as estimated in the real experiment (and to the parameter of interest value I am testing) ? Or from what else ?
And another question: for a given toy, is it correct to assume that the expected number of counts is obtained from the values of the global observables assigned to the given toy ? And that such values for the global observables are drawn from the pdfs of the nuisance parameters centered around the best-fitted values for the nuisance parameters conditioned at the parameter of interest value I am testing ?

Sorry for the many questions. Looking forward to hearing from you
Cheers
Giacomo