residuals_plot¶
- residuals_plot(model: Model) None
Plots the residuals \(\epsilon\) with respect to predicted values \(\hat{y}\).
Parameters¶
- modelbaypy.model.model.Model
The model with data, regressors, response variable and priors to be solved through Monte Carlo sampling.
Raises¶
- TypeError
If
modelis not abaypy.model.model.Model.- ValueError
If a
model.posteriorsisNonebecause the sampling has not been done yet,if a posterior key is not a column of
model.data,if
model.datais an emptypandas.DataFrame,if
model.response_variableis not a column ofmodel.data.
See Also¶
Notes¶
Predicted values are computed at data points \(X\) using the posteriors means for each regressor’s parameter. In the case of linear model:
\[\hat{y_i} = \beta_0 + \sum_{j = 1}^{m} \beta_j x_{i,j}\]while residuals are the difference between the observed values and the predicted values of the
response_variable:\[\epsilon_i = y_i - \hat{y_i}\]