ConcatenatedPredictor

class remu.likelihood.ConcatenatedPredictor(predictors, share_parameters=False, combine_systematics='cartesian')[source]

Bases: remu.likelihood.Predictor

Wrapper class that concatenates predictions of multiple Predictors.

Parameters
predictorslist of Predictor

The Predictors whos output will be concateanted.

share_parametersbool, default=False

If True, the predictors must accept the same number of parameters. The resulting predictor will then accept the same number and apply them to all. Otherwise the resulting Predictor will accept the concatenated list of the separate original input parameters in the same order as they appear in predictors.

combine_systematicsstring, optional

The strategy how to combine the systematics of the Predictors. Default: “cartesian”

See also

SummedPredictor

Notes

Systematics will be handled according to the combine_systematics parameter. Possible values are:

"cartesian"

Combine systematics in a Cartesian product. There will be one output prediction for each possible combination of intermediate systematics.

"same"

Assume that the systamtics are the same and no combination is done. The dimensions and weights for the systematics _must_ be identical for all provided Predictors.

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[, systematics_index])

Turn a set of parameters into an ndarray of predictions.

check_bounds(parameters)

Check that all parameters are within bounds.

compose(other)

Return a new Predictor that is a composition with other.

new_predictor(parameters) = self(other(parameters))
fix_parameters(fix_values)

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, systematics_index=slice(None, None, None))[source]

Turn a set of parameters into an ndarray of predictions.

Parameters
parametersndarray
systematics_indexint, optional
Returns
prediction, weightsndarray

Notes

The optional argument systematics_index will be applied to the final output of the summed predictions, i.e. the flattened combination of the original systematics.