MatrixPredictor

class remu.likelihood.MatrixPredictor(matrices, constants=0.0, *, sparse_indices=slice(None, None, None), **kwargs)[source]

Bases: remu.likelihood.LinearEinsumPredictor

Predictor that uses a matrix to fold parameters into reco space.

output = matrix X parameters [+ constants]
Parameters
matricesndarray

Shape: ([n_systematics,]n_reco_bins,n_parameters)

constantsndarray, optional

Shape: ([n_systematics,]n_reco_bins)

weightsndarray, optional

Shape: (n_systematics)

boundsndarray, optional

Lower and upper bounds for all parameters. Can be +/- np.inf.

defaultsndarray, optional

“Reasonable” default values for the parameters. Used in optimisation.

sparse_indiceslist or array of int, optional

Used with sparse matrices that provide only the specified columns. All other columns are assumed to be 0, i.e. the parameters corresponding to these have no effect.

See also

Predictor

Attributes

bounds

(ndarray) Lower and upper bounds for all parameters. Can be +/- np.inf.

defaults

(ndarray) “Reasonable” default values for the parameters. Used optimisation.

sparse_indices

(list or array of int or slice) Used with sparse matrices that provide only the specified columns. All other columns are assumed to be 0, i.e. the parameters corresponding to these have no effect.

Methods

__call__(*args, **kwargs)

See prediction().

check_bounds(parameters)

Check that all parameters are within bounds.

compose(other)

Return a new Predictor that is a composition with other.

fix_parameters(fix_values)

Return a new Predictor with fewer free parameters.

prediction(parameters, *args, **kwargs)

Turn a set of parameters into a reco prediction.

check_bounds(parameters)

Check that all parameters are within bounds.

compose(other)[source]

Return a new Predictor that is a composition with other.

new_predictor(parameters) = self(other(parameters))
fix_parameters(fix_values)[source]

Return a new Predictor with fewer free parameters.

Parameters
fix_valuesiterable

List of the parameter values that the parameters should be fixed at. The list must be of the same length as the number of parameters of predictor. Any parameters that should remain unfixed should be specified with None or np.nan.

prediction(parameters, *args, **kwargs)[source]

Turn a set of parameters into a reco prediction.

Returns
predictionndarray
weightsndarray