JeffreysPrior

class remu.likelihood.JeffreysPrior(response_matrix, translation_function, parameter_limits, default_values, dx=None, total_truth_limit=None)[source]

Universal non-informative prior for use in Bayesian MCMC analysis.

Parameters:
response_matrix : ndarray

Response matrix that translates truth into reco bins. Can be an array of matrices.

translation_function : function

The function to translate a vector of parameters into a vector of truth expectation values:

truth_vector = translation_function(parameter_vector)

It must support translating arrays of parameter vectors into arrays of truth vectors:

[truth_vector, ...] = translation_function([parameter_vector, ...])
parameter_limits : iterable of tuple of floats

An iterable of lower and upper limits of the hypothesis’ parameters. The number of limits determines the number of parameters. Parameters can be None. This sets no limit in that direction.

[ (x1_min, x1_max), (x2_min, x2_max), ... ]
default_values : iterable of floats

The default values of the parameters

dx : array like

Array of step sizes to be used in numerical differentiation. Default: numpy.full(len(parameter_limits), 1e-3)

total_truth_limit : float

Maximum total number of truth events to consider in the prior. This can be used to make priors proper in a consistent way, since the limit is defined in the truth space, rather than the prior parameter space.

Notes

The JeffreysPrior object can be called like a function. It will return the prior log-likliehood of the given set of parameters:

prior_likelihood = jeffreys_prior(parameter_vector)

If the prior was constructed with more than one response matrix, the matrix to be used for the calculation can be chosen with the toy_index argument:

jeffreys_prior(parameter_vector, toy_index=5)

By construction, the JeffreysPrior will return the log probability -inf, a probability of 0, when the expected reco values do not depend on one of the parameters. In this case the “useless” parameter should be removed. It simply cannot be constrained with the given detector response.

fisher_matrix(parameters, toy_index=0)[source]

Calculate the Fisher information matrix for the given parameters.

Parameters:
parameters : aray like

The parameters of the translation function.

toy_index : int, optional

The index of the response matrix to be used for the calculation

Returns:
ndarray

The Fisher information matrix.