hepstats.utils#

hepstats.utils.fit#

hepstats.utils.fit.api_check#

Module for testing a fitting library validity with hepstats.

A fitting library should provide six basic objects:

  • model / probability density function

  • parameters of the models

  • data

  • loss / likelihood function

  • minimizer

  • fitresult (optional)

A function for each object is defined in this module, all should return True to work with hepstats.

The zfit API is currently the standard fitting API in hepstats.

is_valid_parameter(object)

Checks if a parameter has the following attributes/methods:

is_valid_data(object)

Checks if the data object has the following attributes/methods:

is_valid_pdf(object)

Checks if the pdf object has the following attributes/methods:

is_valid_loss(object)

Checks if the loss object has the following attributes/methods:

is_valid_fitresult(object)

Checks if the fit result object has the following attributes/methods:

is_valid_minimizer(object)

Checks if the minimzer object has the following attributes/methods:

hepstats.utils.fit.diverse#

get_value(value)

eval_pdf(model, x[, params, allow_extended])

Compute pdf of model at a given point x and for given parameters values

pll(minimizer, loss, pois[, init])

Compute minimum profile likelihood for fixed given parameters values.

array2dataset(dataset_cls, obs, array[, weights])

dataset_cls: only used to get the class in which array/weights will be converted.

get_nevents(dataset)

Returns the number of events in the dataset

hepstats.utils.fit.sampling#

base_sampler(models, nevents)

Creates samplers from models.

base_sample(samplers, ntoys[, parameter, ...])

Samples from samplers.