arviz.smooth_data#

arviz.smooth_data(obs_vals, pp_vals)[source]#

Smooth data using a cubic spline.

Helper function for discrete data in plot_pbv, loo_pit and plot_loo_pit.

Parameters:
obs_vals(N) array_like

Observed data

pp_vals(S, N) array_like

Posterior predictive samples. N is the number of observations, and S is the number of samples (generally n_chains*n_draws).

Returns:
obs_vals(N) ndarray

Smoothed observed data

pp_vals(S, N) ndarray

Smoothed posterior predictive samples