pyhf.infer.calculators.generate_asimov_data#

pyhf.infer.calculators.generate_asimov_data(asimov_mu, data, pdf, init_pars, par_bounds, fixed_params, return_fitted_pars=False)[source]#

Compute Asimov Dataset (expected yields at best-fit values) for a given POI value.

Example

>>> import pyhf
>>> pyhf.set_backend("numpy")
>>> model = pyhf.simplemodels.uncorrelated_background(
...     signal=[12.0, 11.0], bkg=[50.0, 52.0], bkg_uncertainty=[3.0, 7.0]
... )
>>> observations = [51, 48]
>>> data = observations + model.config.auxdata
>>> mu_test = 1.0
>>> pyhf.infer.calculators.generate_asimov_data(mu_test, data, model, None, None, None)
array([ 60.61229858,  56.52802479, 270.06832542,  48.31545488])
>>> pyhf.infer.calculators.generate_asimov_data(
...     mu_test, data, model, None, None, None, return_fitted_pars=True
... )
(array([ 60.61229858,  56.52802479, 270.06832542,  48.31545488]), array([1.        , 0.97224597, 0.87553894]))
Parameters:
  • asimov_mu (float) – The value for the parameter of interest to be used.

  • data (tensor) – The observed data.

  • pdf (Model) – The statistical model adhering to the schema model.json.

  • init_pars (tensor of float) – The starting values of the model parameters for minimization.

  • par_bounds (tensor) – The extrema of values the model parameters are allowed to reach in the fit. The shape should be (n, 2) for n model parameters.

  • fixed_params (tuple or list of bool) – The flag to set a parameter constant to its starting value during minimization.

  • return_fitted_pars (bool) – Return the best-fit parameter values for the given asimov_mu.

Returns:

  • The Asimov dataset.

  • The Asimov parameters. Only returned if return_fitted_pars is True.

Return type:

A Tensor or a Tuple of two Tensors