hypney.statistics package

Submodules

hypney.statistics.count module

class hypney.statistics.count.AugmentedCount(model: ~hypney.model.Model, data=<class 'hypney.basics.NotChanged'>, params=<class 'hypney.basics.NotChanged'>, dist=None, **kwargs)

Bases: Statistic

Number of events in dataset + a random [0,1] number (fixed when initializing data)

Attributes
data
dist

Methods

__call__([data, dist, params])

Call self as a function.

dist_from_toys([params, n_toys, transform, ...])

Return an estimated distribution of the statistic given params from running simulations.

interpolate_dist_from_toys(anchors[, ...])

Estimate this statistic's distribution by Monte Carlo.

rvs([size, params, transform, ...])

Return statistic evaluated on simulated data, generated from model with params

set([data, dist, params])

Return a statistic with possibly changed data or distribution

with_stored_dist(dist_filename[, n_toys, ...])

Return statistic with distribution loaded from cache_dir, or rebuilt from toy mc if file does not exist

compute

model: Model
class hypney.statistics.count.Count(model: ~hypney.model.Model, data=<class 'hypney.basics.NotChanged'>, params=<class 'hypney.basics.NotChanged'>, dist=None, **kwargs)

Bases: Statistic

Attributes
data
dist

Methods

__call__([data, dist, params])

Call self as a function.

dist_from_toys([params, n_toys, transform, ...])

Return an estimated distribution of the statistic given params from running simulations.

interpolate_dist_from_toys(anchors[, ...])

Estimate this statistic's distribution by Monte Carlo.

rvs([size, params, transform, ...])

Return statistic evaluated on simulated data, generated from model with params

set([data, dist, params])

Return a statistic with possibly changed data or distribution

with_stored_dist(dist_filename[, n_toys, ...])

Return statistic with distribution loaded from cache_dir, or rebuilt from toy mc if file does not exist

compute

model: Model

hypney.statistics.likelihood module

class hypney.statistics.likelihood.LikelihoodRatio(model, *args, max_est=None, **kwargs)

Bases: Statistic

Attributes
data
dist

Methods

__call__([data, dist, params])

Call self as a function.

dist_from_toys([params, n_toys, transform, ...])

Return an estimated distribution of the statistic given params from running simulations.

interpolate_dist_from_toys(anchors[, ...])

Estimate this statistic's distribution by Monte Carlo.

rvs([size, params, transform, ...])

Return statistic evaluated on simulated data, generated from model with params

set([data, dist, params])

Return a statistic with possibly changed data or distribution

with_stored_dist(dist_filename[, n_toys, ...])

Return statistic with distribution loaded from cache_dir, or rebuilt from toy mc if file does not exist

compute

model: Model
class hypney.statistics.likelihood.LogLikelihood(model: ~hypney.model.Model, data=<class 'hypney.basics.NotChanged'>, params=<class 'hypney.basics.NotChanged'>, dist=None, **kwargs)

Bases: Statistic

Attributes
data
dist

Methods

__call__([data, dist, params])

Call self as a function.

dist_from_toys([params, n_toys, transform, ...])

Return an estimated distribution of the statistic given params from running simulations.

interpolate_dist_from_toys(anchors[, ...])

Estimate this statistic's distribution by Monte Carlo.

rvs([size, params, transform, ...])

Return statistic evaluated on simulated data, generated from model with params

set([data, dist, params])

Return a statistic with possibly changed data or distribution

with_stored_dist(dist_filename[, n_toys, ...])

Return statistic with distribution loaded from cache_dir, or rebuilt from toy mc if file does not exist

compute

model: Model
class hypney.statistics.likelihood.PLR(*args, poi='rate', **kwargs)

Bases: LikelihoodRatio

Attributes
data
dist
only_poi

Returns single parameter of interest,

Methods

__call__([data, dist, params])

Call self as a function.

dist_from_toys([params, n_toys, transform, ...])

Return an estimated distribution of the statistic given params from running simulations.

interpolate_dist_from_toys(anchors[, ...])

Estimate this statistic's distribution by Monte Carlo.

rvs([size, params, transform, ...])

Return statistic evaluated on simulated data, generated from model with params

set([data, dist, params])

Return a statistic with possibly changed data or distribution

with_stored_dist(dist_filename[, n_toys, ...])

Return statistic with distribution loaded from cache_dir, or rebuilt from toy mc if file does not exist

compute

model: Model
property only_poi

Returns single parameter of interest, crashes if there is more than one

class hypney.statistics.likelihood.PLROrZero(*args, zero_if='high', **kwargs)

Bases: PLR

Attributes
data
dist
only_poi

Returns single parameter of interest,

Methods

__call__([data, dist, params])

Call self as a function.

dist_from_toys([params, n_toys, transform, ...])

Return an estimated distribution of the statistic given params from running simulations.

interpolate_dist_from_toys(anchors[, ...])

Estimate this statistic's distribution by Monte Carlo.

rvs([size, params, transform, ...])

Return statistic evaluated on simulated data, generated from model with params

set([data, dist, params])

Return a statistic with possibly changed data or distribution

with_stored_dist(dist_filename[, n_toys, ...])

Return statistic with distribution loaded from cache_dir, or rebuilt from toy mc if file does not exist

compute

model: Model
class hypney.statistics.likelihood.SignedPLR(*args, poi='rate', **kwargs)

Bases: PLR

Attributes
data
dist
only_poi

Returns single parameter of interest,

Methods

__call__([data, dist, params])

Call self as a function.

dist_from_toys([params, n_toys, transform, ...])

Return an estimated distribution of the statistic given params from running simulations.

interpolate_dist_from_toys(anchors[, ...])

Estimate this statistic's distribution by Monte Carlo.

rvs([size, params, transform, ...])

Return statistic evaluated on simulated data, generated from model with params

set([data, dist, params])

Return a statistic with possibly changed data or distribution

with_stored_dist(dist_filename[, n_toys, ...])

Return statistic with distribution loaded from cache_dir, or rebuilt from toy mc if file does not exist

compute

model: Model

Module contents