Skip to content

Conversation

@aloctavodia
Copy link
Contributor

@aloctavodia aloctavodia commented Sep 11, 2025

I started working on adding a smooth option to plot_lm as presented in #317. But after playing a little bit with the function, I decided to incorporate other changes, which may be a better fit given the design and expectations of other plots in ArviZ. But given that plot_lm has always been a weird plot for us, and I may be too focused on what I want to do, and then miss other uses. So, to make things more concrete, I will show the steps of the two main use cases I have in mind. Notice the combine function I am adding in this PR; I may be overcomplicating things there, or not making the correct assumptions (e.g., it fails when ci_prob is a list instead of a float).

A common pattern in ArviZ-plots is to create a DataTree first, plot second. So I follow that pattern here. For instance, the arguments "x" and "y" are equivalent to "var_names" in other plots.

For the most straightforward example, we have a linear regression with only one predictor. Here I am using the bikes dataset and a NegativeBinomial family, the model is essentially.

rented ~ temperature

Once the model is sampled, we do

idata_lb.add_groups({"constant_data": xr.DataArray(bikes.temperature)})

And then we can plot the predictions with

azp.plot_lm(idata_lb)
00

Multiple bands

pc = azp.plot_lm(idata_lb,
                 ci_prob=[0.5, 0.9, 0.95],
                 visuals={"observed_scatter":False,
                          "pe_line": False})
output

Notice the y-axis labels are not correct yet.

More often than not. We have regression models with more than one covariate. For those cases, what we want to plot is the marginal predictions (or marginals eta/linear-terms).

rented ~ temperature + humidity

For such models, we need to compute the marginals somehow. PyMC-BART has custom functions for this that take advantage of the tree structure to efficiently compute predictions. Bambi has the interpret module for the slope/predictions. I mention those for context, but also because, at least in the PyMC-BART case, it would be nice to replace the plotting part with arviz-plots.

Assuming we want to compute the marginals manually, we could do something like this

import xarray as xr
from xarray_einstats.stats import XrDiscreteRV
import preliz as pz

# Compute marginal "slopes"
alpha = idata_lb.posterior["α"]
beta = idata_lb.posterior["β"]
scale = idata_lb.posterior["scale"]


mut = np.exp(alpha + beta.sel(β_dim_0=0) * xr.DataArray(bikes.temperature, dims="μ_t_dim_0") + beta.sel(β_dim_0=1) * bikes.humidity.mean())
muh = np.exp(alpha + beta.sel(β_dim_0=0) * bikes.temperature.mean() + beta.sel(β_dim_0=1) * xr.DataArray(bikes.humidity, dims="μ_h_dim_0"))

idata_lb.posterior["μ_t"] = mut
idata_lb.posterior["μ_h"] = muh

# Compute marginal predictions
y_pred_t = XrDiscreteRV(pz.NegativeBinomial, mut, scale).rvs()
y_pred_h = XrDiscreteRV(pz.NegativeBinomial, muh, scale).rvs()

idata_lb.posterior_predictive["y_pred_t"] = y_pred_t
idata_lb.posterior_predictive["y_pred_h"] = y_pred_h

dt_cd = azb.from_dict(
    {"constant_data": {
        "temperature": bikes.temperature.to_numpy(),
        "humidity": bikes.humidity.to_numpy(),
    }},
    dims={"temperature": ["dim_0"], "humidity": ["dim_0"]},
)
idata_lb["constant_data"] = dt_cd["constant_data"].to_dataset()

After that, we can plot the marginal values i.e., how the mean of the rented bikes changes with temperature when we keep the humidity at its mean value. and the other way around

pc = azp.plot_lm(idata_lb,
                x=["temperature", "humidity"],
                y=["y_pred_t", "y_pred_h"],
                y_obs="y_pred",
                visuals={"ci_band":{},  "pe_line":{}, "observed_scatter":False},
                )
01

We may want to plot the posterior means, instead of predictions

pc = azp.plot_lm(idata_lb,
                group="posterior",
                x=["temperature", "humidity"],
                y=["μ_t", "μ_h"],
                y_obs="y_pred",
                visuals={"ci_bounds":True, "pe_line":{}, "observed_scatter":False},
                )
02

📚 Documentation preview 📚: https://arviz-plots--343.org.readthedocs.build/en/343/

@codecov-commenter
Copy link

codecov-commenter commented Sep 11, 2025

Codecov Report

❌ Patch coverage is 3.47826% with 111 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.29%. Comparing base (5dd3aef) to head (ad0c50e).

Files with missing lines Patch % Lines
src/arviz_plots/plots/lm_plot.py 3.47% 111 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #343      +/-   ##
==========================================
- Coverage   85.94%   85.29%   -0.66%     
==========================================
  Files          48       48              
  Lines        6014     6060      +46     
==========================================
  Hits         5169     5169              
- Misses        845      891      +46     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aloctavodia aloctavodia marked this pull request as ready for review September 17, 2025 07:00
@juanitorduz
Copy link

juanitorduz commented Sep 17, 2025

This looks awesome!

So this is doing almost the same as the old plot_hdi? Do you want to include the smoothing option? Ok, you did :D

@aloctavodia
Copy link
Contributor Author

It is doing similar things. Maybe we don't need to have a separate function like plot_hdi if this is easy to use and flexible enough.

@juanitorduz
Copy link

Agree! This looks great! Thank you!

Copy link
Member

@OriolAbril OriolAbril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like most of the changes but we need more examples both to showcase that in the docs and for user testing.

Comment on lines 122 to 126
* pe_line-> passed to :func:`~.visuals.line_xy`.
* ci_band -> passed to :func:`~.visuals.fill_between_y`.
* ci_bounds -> passed to :func:`~.visuals.line_xy`. Defaults to False
* ci_line_y -> passed to :func:`~.visuals.ci_line_y`. Defaults to False
* observed_scatter -> passed to :func:`~.visuals.scatter_xy`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the new names because they are more descriptive, but I think it is still a bit confusing. I would add a short description of each visual element along with the function arguments are passed to


for xv, yv in zip(x_vars, y_vars):
old_dim = pe_value[yv].dims[0]
y_aligned = pe_value[yv].rename({old_dim: "dim_0"}).reindex(dim_0=x_pred.dim_0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dim_0 has a probability of name clash too high to use it here and without fallback. If we keep this I think we should use a different name.

However, I am not sure we should keep this. I think the goal of this from the example is to have μ_t and μ_h with different dimension names work in here but I think those dimensions should have been named the same from the beginning and match the dimension name for the variables in observed_data and in constant_data

Comment on lines 464 to 477
values = np.stack([x_pred[xv].values, y_aligned.values, lower, upper], axis=0)
order = np.argsort(values[0])
values_sorted = values[:, order]
x_sorted = values_sorted[0]

if smooth:
x_grid = np.linspace(x_sorted.min(), x_sorted.max(), n_points)
x_grid[0] = (x_grid[0] + x_grid[1]) / 2
values_smoothed = np.zeros((4, n_points))
values_smoothed[0] = x_grid
for i in range(1, 4):
y_interp = griddata(x_sorted, values_sorted[i], x_grid)
values_smoothed[i] = savgol_filter(y_interp, axis=0, **smooth_kwargs)
values_sorted = values_smoothed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have an issue to move all this to arviz-stats?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's easier to discuss what we want here, and once we are happy, move this to arviz-stats. We have an open issue about smoothing HDIs; this could solve it. I think is fine to have this functionality just for plot_lm, not sure we need to expose it as an independent feature.

if smooth:
new_dim = xr.IndexVariable("dim_0", np.arange(n_points))
else:
new_dim = x_pred.dim_0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not do this as I think it will not be correct in a lot of cases. Data is always sorted so the plot looks good and makes sense, so we'd have to take that from x_sorted. However, when there are multiple variables, x_sorted will have a different order for each potentially which would mean the final creation of the dataset of of combined_data would undo the sorting for all variables but one.

I see this as the main argument to change the dimension name to something else. However, sort which does this kind of sorting, removes the coordinate values from the dimension instead. The dimension is conceptually the same, but the coordinate values might no longer make sense and they might also not be aligned between variables/dimensions (if we added support for multiple dimensions in addition to this dim_0 which could be then be facetted on or get aesthetic mappings)

Comment on lines 345 to 346
# This is intended for categorical x values or few unique values of x
# where fill_between_y is not appropriate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is what I would add to the description of the visuals I mentioned in another comment. I think moving is fine, but copying also ok with me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will move this up. This was also a reminder to discuss that it would be nice to be able to automatically, or by having a "var_discrete" argument, to have a mix of continuous and discrete/categorical.

if smooth:
new_dim = xr.IndexVariable("dim_0", np.arange(n_points))
else:
new_dim = x_pred.dim_0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not do this as I think it will not be correct in a lot of cases. Data is always sorted so the plot looks good and makes sense, so we'd have to take that from x_sorted. However, when there are multiple variables, x_sorted will have a different order for each potentially which would mean the final creation of the dataset of of combined_data would undo the sorting for all variables but one.

I see this as the main argument to change the dimension name to something else. However, sort which does this kind of sorting, removes the coordinate values from the dimension instead. The dimension is conceptually the same, but the coordinate values might no longer make sense and they might also not be aligned between variables/dimensions (if we added support for multiple dimensions in addition to this dim_0 which could be then be facetted on or get aesthetic mappings)

@aloctavodia
Copy link
Contributor Author

I have addressed some of your comments @OriolAbril, the easy ones. Regarding what to do with the combine function, I am not entirely sure what the best approach is, but I agree that the current one feels hacky. We could have a meeting to discuss details, or maybe you can try an alternative yourself, or both.

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.
x : str optional
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
x : str optional
x : str, optional

x is used.
x : str optional
Independent variable. If None, use the first variable in constant_data group.
y : str optional
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
y : str optional
y : str, optional

Independent variable. If None, use the first variable in constant_data group.
y : str optional
Response variable or linear term. If None, use the first variable in observed_data group.
y_obs : str or DataArray, optional
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to explain the difference between y and y_obs a bit more. They're looked up in different groups, right? I would mention it.

Also, why does it make different assumptions about y and y_obs? I can imagine it's related to variables available in the different groups, but I'm not sure.

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are y_pred and x_pred still relevant to the user?

* central_line -> passed to :func:`~.visuals.line_xy`.
* ci_fill -> passed to :func:`~.visuals.fill_between_y`.
* scatter -> passed to :func:`~.visuals.scatter_xy`.
* pe_line-> passed to :func:`~.visuals.line_xy`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are spaces between lines and around -> meaningful for doc building? Asking to make sure things are lay out as expected.

y = process_group_variables_coords(
dt, group="observed_data", var_names=y, filter_vars=filter_vars, coords=coords
)
y = list(obs_data.data_vars)[:1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens with x and y if either observed_data or constant_data do not exist? Would get_group work? Maybe it makes sense to first check availability of the groups, then availability of data vars within the groups, and then raise appropriate errors if needed?

)
if isinstance(ci_prob, Sequence):
aes_by_visuals.setdefault("ci_line", {"alpha"})
if isinstance(ci_prob, (list | tuple | np.ndarray)):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this check in several places. As far as I understand, you use it to act different in the presence of multiple intervals instead of one.

Would it make sense to convert ci_prob to a one-dimensional numpy array early on, and then always act as if they are many? Perhaps something custom can be done if len(arr) == 1.

pe_value = azs.mode(y_pred, dim=central_line_dims, **stats.get("point_estimate", {}))

lines = plot_bknd.get_default_aes("linestyle", 2, {})
ds_combined = combine(x_pred, pe_value, ci_data, x, y, smooth, stats.get("smooth", {}))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstring mentions the valid keys for stats are credible_interval and point_estimate... something needs an update?

Combine and sort x_pred, pe_value, ci_data into a dataset.
The resulting dataset will have a dimension plot_axis=['x','y','y_bottom','y_top'],
and will sort each variable by its x values, and optionally smooth along dim_0.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think dim_0 is wrong?

@read-the-docs-community
Copy link

read-the-docs-community bot commented Oct 31, 2025

Documentation build overview

📚 arviz-plots | 🛠️ Build #30158331 | 📁 Comparing 56658bb against latest (55ba905)


🔍 Preview build

Show files changed (175 files in total): 📝 164 modified | ➕ 4 added | ➖ 7 deleted
File Status
genindex.html 📝 modified
_modules/index.html 📝 modified
api/helpers.html 📝 modified
api/managers.html 📝 modified
api/plots.html 📝 modified
contributing/testing.html 📝 modified
gallery/add_reference_bands.html 📝 modified
gallery/add_reference_lines.html 📝 modified
gallery/combine_plots.html 📝 modified
gallery/index.html 📝 modified
gallery/plot_autocorr.html 📝 modified
gallery/plot_bf.html 📝 modified
gallery/plot_compare.html 📝 modified
gallery/plot_convergence_dist.html 📝 modified
gallery/plot_dist_ecdf.html 📝 modified
gallery/plot_dist_hist.html 📝 modified
gallery/plot_dist_kde.html 📝 modified
gallery/plot_dist_models.html 📝 modified
gallery/plot_ecdf_coverage.html 📝 modified
gallery/plot_ecdf_pit.html 📝 modified
gallery/plot_energy.html 📝 modified
gallery/plot_ess_evolution.html 📝 modified
gallery/plot_ess_local.html 📝 modified
gallery/plot_ess_models.html 📝 modified
gallery/plot_ess_quantile.html 📝 modified
gallery/plot_forest.html 📝 modified
gallery/plot_forest_ess.html 📝 modified
gallery/plot_forest_models.html 📝 modified
gallery/plot_forest_pp_obs.html 📝 modified
gallery/plot_forest_shade.html 📝 modified
gallery/plot_loo_pit.html 📝 modified
gallery/plot_mcse.html 📝 modified
gallery/plot_pair.html 📝 modified
gallery/plot_pair_distribution.html 📝 modified
gallery/plot_pair_focus.html 📝 modified
gallery/plot_pair_focus_distribution.html 📝 modified
gallery/plot_parallel.html 📝 modified
gallery/plot_pava_calibration.html 📝 modified
gallery/plot_ppc_censored.html ➖ deleted
gallery/plot_ppc_coverage.html 📝 modified
gallery/plot_ppc_dist.html 📝 modified
gallery/plot_ppc_interval.html 📝 modified
gallery/plot_ppc_pit.html 📝 modified
gallery/plot_ppc_rootogram.html 📝 modified
gallery/plot_ppc_tstat.html 📝 modified
gallery/plot_prior_posterior.html 📝 modified
gallery/plot_psense.html 📝 modified
gallery/plot_psense_quantities.html 📝 modified
gallery/plot_rank.html 📝 modified
gallery/plot_rank_dist.html 📝 modified
gallery/plot_ridge.html 📝 modified
gallery/plot_ridge_multiple.html 📝 modified
gallery/plot_trace.html 📝 modified
gallery/plot_trace_dist.html 📝 modified
tutorials/overview.html 📝 modified
_modules/arviz_plots/plot_collection.html 📝 modified
_modules/arviz_plots/plot_matrix.html 📝 modified
api/backend/bokeh.html 📝 modified
api/backend/index.html 📝 modified
api/backend/matplotlib.html 📝 modified
api/backend/none.html 📝 modified
api/backend/plotly.html 📝 modified
api/generated/arviz_plots.PlotCollection.allocate_artist.html 📝 modified
api/generated/arviz_plots.PlotCollection.generate_aes_dt.html 📝 modified
api/generated/arviz_plots.PlotCollection.grid.html 📝 modified
api/generated/arviz_plots.PlotCollection.html 📝 modified
api/generated/arviz_plots.PlotCollection.wrap.html 📝 modified
api/generated/arviz_plots.PlotMatrix.html 📝 modified
api/generated/arviz_plots.plot_dist.html 📝 modified
api/generated/arviz_plots.plot_ecdf_pit.html 📝 modified
api/generated/arviz_plots.plot_lm.html 📝 modified
api/generated/arviz_plots.plot_loo_pit.html 📝 modified
api/generated/arviz_plots.plot_parallel.html 📝 modified
api/generated/arviz_plots.plot_ppc_censored.html ➖ deleted
api/generated/arviz_plots.plot_ppc_dist.html 📝 modified
api/generated/arviz_plots.plot_ppc_pit.html 📝 modified
api/generated/arviz_plots.plot_rank.html 📝 modified
api/generated/arviz_plots.plot_rank_dist.html 📝 modified
_modules/arviz_plots/backend/bokeh.html ➕ added
_modules/arviz_plots/backend/matplotlib.html ➕ added
_modules/arviz_plots/backend/none.html ➕ added
_modules/arviz_plots/backend/plotly.html ➕ added
_modules/arviz_plots/plots/autocorr_plot.html 📝 modified
_modules/arviz_plots/plots/bf_plot.html 📝 modified
_modules/arviz_plots/plots/combine.html 📝 modified
_modules/arviz_plots/plots/compare_plot.html 📝 modified
_modules/arviz_plots/plots/convergence_dist_plot.html 📝 modified
_modules/arviz_plots/plots/dist_plot.html 📝 modified
_modules/arviz_plots/plots/ecdf_plot.html 📝 modified
_modules/arviz_plots/plots/ess_plot.html 📝 modified
_modules/arviz_plots/plots/evolution_plot.html 📝 modified
_modules/arviz_plots/plots/forest_plot.html 📝 modified
_modules/arviz_plots/plots/lm_plot.html 📝 modified
_modules/arviz_plots/plots/loo_pit_plot.html 📝 modified
_modules/arviz_plots/plots/mcse_plot.html 📝 modified
_modules/arviz_plots/plots/pair_focus_plot.html 📝 modified
_modules/arviz_plots/plots/pair_plot.html 📝 modified
_modules/arviz_plots/plots/parallel_plot.html 📝 modified
_modules/arviz_plots/plots/pava_calibration_plot.html 📝 modified
_modules/arviz_plots/plots/ppc_censored_plot.html ➖ deleted
_modules/arviz_plots/plots/ppc_dist_plot.html 📝 modified
_modules/arviz_plots/plots/ppc_pit_plot.html 📝 modified
_modules/arviz_plots/plots/ppc_rootogram_plot.html 📝 modified
_modules/arviz_plots/plots/ppc_tstat.html 📝 modified
_modules/arviz_plots/plots/psense_dist_plot.html 📝 modified
_modules/arviz_plots/plots/psense_quantities_plot.html 📝 modified
_modules/arviz_plots/plots/rank_dist_plot.html 📝 modified
_modules/arviz_plots/plots/rank_plot.html 📝 modified
_modules/arviz_plots/plots/ridge_plot.html 📝 modified
_modules/arviz_plots/plots/trace_dist_plot.html 📝 modified
_modules/arviz_plots/plots/trace_plot.html 📝 modified
_modules/arviz_plots/plots/utils.html 📝 modified
api/backend/generated/arviz_plots.backend.bokeh.create_plotting_grid.html 📝 modified
api/backend/generated/arviz_plots.backend.bokeh.line.html 📝 modified
api/backend/generated/arviz_plots.backend.bokeh.multiple_lines.html 📝 modified
api/backend/generated/arviz_plots.backend.bokeh.remove_axis.html 📝 modified
api/backend/generated/arviz_plots.backend.bokeh.remove_ticks.html 📝 modified
api/backend/generated/arviz_plots.backend.bokeh.scatter.html 📝 modified
api/backend/generated/arviz_plots.backend.bokeh.show.html 📝 modified
api/backend/generated/arviz_plots.backend.bokeh.text.html 📝 modified
api/backend/generated/arviz_plots.backend.bokeh.ticklabel_props.html 📝 modified
api/backend/generated/arviz_plots.backend.bokeh.title.html 📝 modified
api/backend/generated/arviz_plots.backend.bokeh.xlabel.html 📝 modified
api/backend/generated/arviz_plots.backend.bokeh.xticks.html 📝 modified
api/backend/generated/arviz_plots.backend.bokeh.ylabel.html 📝 modified
api/backend/generated/arviz_plots.backend.bokeh.yticks.html 📝 modified
api/backend/generated/arviz_plots.backend.matplotlib.create_plotting_grid.html 📝 modified
api/backend/generated/arviz_plots.backend.matplotlib.line.html 📝 modified
api/backend/generated/arviz_plots.backend.matplotlib.multiple_lines.html 📝 modified
api/backend/generated/arviz_plots.backend.matplotlib.remove_axis.html 📝 modified
api/backend/generated/arviz_plots.backend.matplotlib.remove_ticks.html 📝 modified
api/backend/generated/arviz_plots.backend.matplotlib.scatter.html 📝 modified
api/backend/generated/arviz_plots.backend.matplotlib.show.html 📝 modified
api/backend/generated/arviz_plots.backend.matplotlib.text.html 📝 modified
api/backend/generated/arviz_plots.backend.matplotlib.ticklabel_props.html 📝 modified
api/backend/generated/arviz_plots.backend.matplotlib.title.html 📝 modified
api/backend/generated/arviz_plots.backend.matplotlib.xlabel.html 📝 modified
api/backend/generated/arviz_plots.backend.matplotlib.xticks.html 📝 modified
api/backend/generated/arviz_plots.backend.matplotlib.ylabel.html 📝 modified
api/backend/generated/arviz_plots.backend.matplotlib.yticks.html 📝 modified
api/backend/generated/arviz_plots.backend.none.create_plotting_grid.html 📝 modified
api/backend/generated/arviz_plots.backend.none.line.html 📝 modified
api/backend/generated/arviz_plots.backend.none.multiple_lines.html 📝 modified
api/backend/generated/arviz_plots.backend.none.remove_axis.html 📝 modified
api/backend/generated/arviz_plots.backend.none.remove_ticks.html 📝 modified
api/backend/generated/arviz_plots.backend.none.scatter.html 📝 modified
api/backend/generated/arviz_plots.backend.none.show.html 📝 modified
api/backend/generated/arviz_plots.backend.none.text.html 📝 modified
api/backend/generated/arviz_plots.backend.none.ticklabel_props.html 📝 modified
api/backend/generated/arviz_plots.backend.none.title.html 📝 modified
api/backend/generated/arviz_plots.backend.none.xlabel.html 📝 modified
api/backend/generated/arviz_plots.backend.none.xticks.html 📝 modified
api/backend/generated/arviz_plots.backend.none.ylabel.html 📝 modified
api/backend/generated/arviz_plots.backend.none.yticks.html 📝 modified
api/backend/generated/arviz_plots.backend.plotly.create_plotting_grid.html 📝 modified
api/backend/generated/arviz_plots.backend.plotly.line.html 📝 modified
api/backend/generated/arviz_plots.backend.plotly.multiple_lines.html 📝 modified
api/backend/generated/arviz_plots.backend.plotly.remove_axis.html 📝 modified
api/backend/generated/arviz_plots.backend.plotly.remove_ticks.html 📝 modified
api/backend/generated/arviz_plots.backend.plotly.scatter.html 📝 modified
api/backend/generated/arviz_plots.backend.plotly.show.html 📝 modified
api/backend/generated/arviz_plots.backend.plotly.text.html 📝 modified
api/backend/generated/arviz_plots.backend.plotly.ticklabel_props.html 📝 modified
api/backend/generated/arviz_plots.backend.plotly.title.html 📝 modified
api/backend/generated/arviz_plots.backend.plotly.xlabel.html 📝 modified
api/backend/generated/arviz_plots.backend.plotly.xticks.html 📝 modified
api/backend/generated/arviz_plots.backend.plotly.ylabel.html 📝 modified
api/backend/generated/arviz_plots.backend.plotly.yticks.html 📝 modified
_modules/arviz_plots/backend/bokeh/core.html ➖ deleted
_modules/arviz_plots/backend/bokeh/legend.html 📝 modified
_modules/arviz_plots/backend/matplotlib/core.html ➖ deleted
_modules/arviz_plots/backend/matplotlib/legend.html 📝 modified
_modules/arviz_plots/backend/none/core.html ➖ deleted
_modules/arviz_plots/backend/plotly/core.html ➖ deleted
_modules/arviz_plots/backend/plotly/legend.html 📝 modified

@OriolAbril
Copy link
Member

I did some experiments, and I like the new API, I am trying to use xarray more to simplify a bit the smoothing and data wrangling.

My main doubt (whose answer might be use a different plot) was about trying to use plot_lm for posterior predictive checks. After noticing some calibration issues, could it be useful in some scenarios to plot with

x=["temperature", "humidity"],
y=["y_pred", "y_pred"],  # won't work now but I think it wouldn't be too hard to make work with the changes I am adding

so we can compare the bands that come from the posterior predictive with the observations and see if we can identify specific regions in temperature or humidity where the model doesn't work well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants