arviz_plots.plot_lm#
- arviz_plots.plot_lm(dt, y=None, x=None, y_pred=None, x_pred=None, filter_vars=None, group='posterior_predictive', coords=None, sample_dims=None, ci_kind=None, ci_prob=None, line_kind=None, plot_collection=None, backend=None, labeller=None, aes_by_visuals=None, visuals=None, stats=None, **pc_kwargs)[source]#
 Posterior predictive and mean plots for regression-like data..
- Parameters:
 - dt
xarray.DataTree Input data
- y
strorxarray.DataArray, optional Target variable. If None (default), the first variable in “observed_data” is used.
- x
strorlistofstrorxarray.DataArrayorxarray.Dataset, optional Independent variable(s). If None (default), all variables in “constant_data” are used.
- y_pred
strorxarray.DataArray, optional Predicted values. If None (default), the variable in the specified group with the same name as y is used.
- x_pred
strorlistofstrorxarray.DataArrayorxarray.Dataset, optional Independent variable(s) for predictions.
If None (default), and if group is “predictions”, all variables corresponding to x data in “predictions_constant_data” group are used. If group is “posterior_predictive”, x is used.
- filter_vars: {None, “like”, “regex”}, default None
 If None (default), interpret var_names as the real variables names. If “like”, interpret var_names as substrings of the real variables names. If “regex”, interpret var_names as regular expressions on the real variables names. It is used for any of y, x, y_pred, and x_pred if they are strings or lists of strings.
- group
str, default “posterior_predictive” Group to use for plotting.
- coordsmapping, optional
 Coordinates to use for plotting.
- sample_dimsiterable, optional
 Dimensions to reduce unless mapped to an aesthetic. Defaults to
rcParams["data.sample_dims"]- ci_kind{“hdi”, “eti”}, optional
 Which credible interval to use. Defaults to
rcParams["stats.ci_kind"]- ci_prob
floatorlistoffloat, optional Indicates the probabilities that should be contained within the plotted credible intervals. Defaults to
rcParams["stats.ci_prob"]- line_kind{“mean”, “median”,”mode”}, optional
 Which point estimate to use for the line. Defaults to
rcParams["stats.point_estimate"]- plot_collection
PlotCollection, optional - backend{“matplotlib”, “bokeh”}, optional
 - labeller
labeller, optional - aes_by_visualsmapping, optional
 Mapping of visuals to aesthetics that should use their mapping in
plot_collectionwhen plotted. Valid keys are the same as forvisuals. By default, there are no aesthetic mappings at all- visualsmapping of {
strmapping or bool}, optional Valid keys are:
ci_line -> passed to
line_xy. Defaults to Falsecentral_line -> passed to
line_xy.ci_fill -> passed to
fill_between_y.scatter -> passed to
scatter_xy.xlabel -> passed to
labelled_x.ylabel -> passed to
labelled_y.
- statsmapping, optional
 Valid keys are:
credible_interval -> passed to eti or hdi
point_estimate -> passed to mean, median or mode
- **pc_kwargs
 Passed to
arviz_plots.PlotCollection.wrap
- dt
 - Returns: