SummedPredictor
- class remu.likelihood.SummedPredictor(predictors, scale_factors=None, combine_systematics='cartesian')[source]
Bases:
remu.likelihood.Predictor
Wrapper class that sums predictions of multiple Predictors.
- Parameters
- predictorslist of Predictor
The Predictors whos output will be added. The resulting Predictor will accept the concatenated list of the separate original input parameters in the same order as they appear in the list.
- scale_factorsiterable of float or arrays: optional
Provide a scaling factor for each predictor. The output will be multiplied with the factor before summing up the predictions. Each factor can also be an array of factors so that each systematic variation gets a different scaling factor. But it needs to be applicable by multiplication, i.e.
scaled_out = factor * out
. This can be achieved by giving each matrix the shape(n_systematics, 1)
.- combine_systematicsstring, optional
The strategy how to combine the systematics of the Predictors. Default: “cartesian”
See also
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
ornp.nan
.
See also
- 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.