The connect_via_regression function#

Aliases#

halerium.core.connect_via_regression
halerium.core.regression.connect_via_regression
connect_via_regression(name_prefix, inputs, outputs, order=1, include_cross_terms=False, inputs_location=None, inputs_scale=None, outputs_location=None, outputs_scale=None, connect_outputs_scale_parameter=False, slope_mean=0, slope_variance=1, intercept_mean=0, intercept_variance=1)#

Connect inputs and outputs via regression.

Parameters:
  • name_prefix (str) – The name prefix for the entities containing the regression parameters. For each variable in outputs, the name to be given to the entity containing the regression parameters, will be named name_prefix + ‘_’ + variable.name.

  • inputs (list of Operator, tuple of Operator, set of Operator, Operator) – The input operand or operands of the regression.

  • outputs (list, tuple, VariableBase) – The output variable or variables of the regression.

  • order (int) – The highest polynomial order of inputs to include in the regression.

  • include_cross_terms (bool) – Whether to include cross terms when order > 1 (don’t do it unless you know what you are doing).

  • inputs_location (optional) – The list of locations for scaling the inputs. These values will be subtracted from the inputs. The default is None (no subtraction).

  • inputs_scale (optional) – The list of scales for scaling the inputs. The inputs will be divided by these values (after subtracting any location parameters). The default is None (no division).

  • outputs_location (optional) – The list of locations for unscaling the outputs. These will be added to the results of the regression (after multiplying by any scale parameter). The default is None (no addition).

  • outputs_scale (optional) – The list of scales for unscaling the outputs. The results of the regression will be multiplied by these values. The default is None (no multiplication).

  • connect_outputs_scale_parameter (bool, str, None, optional) – If True, and the outputs’ distribution has a scale parameter (i.e. “variance” or similar), this is also connected to the inputs via regression. This allows one to learn the intrinsic scatter of the outputs as a function of the inputs. If ‘constant’, the scale parameters are connected to learnable parameters independent of the input. This allows one to learn a constant intrinsic scatter of the outputs independent of the inputs. If False, the scale parameters of the outputs are left untouched.

  • slope_mean (float, np.ndarray, Operator) – The prior mean of the slope.

  • slope_variance (float, np.ndarray, Operator) – The prior variance of the slope.

  • intercept_mean (float, np.ndarray, Operator) – The prior mean of the intercept.

  • intercept_variance (float, np.ndarray, Operator) – The prior variance of the intercept.

Returns:

parameters – a list of the entities holding the regression parameters.

Return type:

List