hepstats.utils.fit.sampling module#

Module providing basic sampling methods.

hepstats.utils.fit.sampling.base_sampler(models, nevents)[source]#

Creates samplers from models.

Parameters:
  • models (list(model)) – models to sample

  • nevents (list(int)) – number of in each sampler

Returns:

Samplers

hepstats.utils.fit.sampling.base_sample(samplers, ntoys, parameter=None, value=None, constraints=None)[source]#

Samples from samplers. The parameters that are floating in the samplers can be set to a specific value using the parameter and value argument.

Parameters:
  • samplers (list) – generators of samples

  • ntoys (int) – number of samples to generate

  • parameter (optional) – floating parameter in the sampler

  • value (optional) – value of the parameter

  • constraints (optional) – constraints to sample

Returns:

sampled values for each constraint

Return type:

dict