arviz_stats.base.array_stats.loo_r2#
- array_stats.loo_r2(y_obs, ypred_loo, n_simulations=4000, circular=False, random_state=42)#
Compute LOO-adjusted R-squared using Dirichlet-weighted bootstrap.
- Parameters:
- y_obsarray_like
Observed values.
- ypred_looarray_like
LOO predictions (same shape as y_obs).
- n_simulations
int, default 4000 Number of Dirichlet-weighted bootstrap samples.
- circularbool, default
False Whether the variable is circular (angles in radians).
- random_state
int, default 42 Random seed for reproducibility.
- Returns:
- loo_r_squaredarray_like
R-squared samples with shape (n_simulations,).