predict_distribution

LinearModel.predict_distribution(predictors: dict[str, float | int]) np.ndarray

It predicts a posterior distribution for an unobserved values. For each posterior sample, it draws a sample from the likelihood.

Parameters

predictorsdict

Values of predictors \(X\) at which compute the posterior distribution. Each predictor has to be set as a key-value pair.

Returns

numpy.ndarray

Array of the predicted posterior distribution. It contains a number of element equal to the number of regression iterations times the number of model Markov chains.

Raises

TypeError

If predictors is not a dict.

KeyError

If a predictors key is not a key of posteriors.

ValueError

If predictors is an empty dict.

See Also

LinearRegression