LinearTerm.predict_elementwise()

LinearTerm.predict_elementwise()#

LinearTerm.predict_elementwise(samples, x=None, indices=None, center=False, scale=False)[source]#

Computes predicted values given an array of posterior samples.

Can be thought of as the individual terms in predict().

Parameters:
  • samples (dict[str, Any]) – Array of posterior samples.

  • x (Optional[Any]) – Array of covariate values. (default: None)

  • indices (Optional[Sequence[int]]) – Sequence of indices, indicating which elements of x to return predictions for. If None predictions are returned for all covariates. (default: None)

  • center (bool) – Whether to center the predictions. (default: False)

  • scale (bool) – Whether to scale the predictions. (default: False)

Return type:

Any

Returns:

Array of prediction values.