bootstrap_statistic
#
- cinnabar.stats.bootstrap_statistic(y_true: ndarray, y_pred: ndarray, dy_true: ndarray | None = None, dy_pred: ndarray | None = None, ci: float = 0.95, statistic: str = 'RMSE', nbootstrap: int = 1000, plot_type: str = 'dG', include_true_uncertainty: bool = False, include_pred_uncertainty: bool = False) dict [source]#
Compute mean and confidence intervals of specified statistic.
- Parameters:
y_true (ndarray with shape (N,)) – True values
y_pred (ndarray with shape (N,)) – Predicted values
dy_true (ndarray with shape (N,) or None) – Errors of true values. If None, the values are assumed to have no errors
dy_pred (ndarray with shape (N,) or None) – Errors of predicted values. If None, the values are assumed to have no errors
ci (float, optional, default=0.95) – Interval for confidence interval (CI)
statistic (str) – Statistic, one of [‘RMSE’, ‘MUE’, ‘R2’, ‘rho’,’KTAU’,’RAE’]
nbootstrap (int, optional, default=1000) – Number of bootstrap samples
plot_type (str, optional, default=’dG’) – ‘dG’ or ‘ddG’
include_true_uncertainty (bool, default False) – whether to account for the uncertainty in y_true when bootstrapping
include_pred_uncertainty (bool, default False) – whether to account for the uncertainty in y_pred when bootstrapping
- Returns:
rmse_stats – ‘mean’ : mean RMSE ‘stderr’ : standard error ‘low’ : low end of CI ‘high’ : high end of CI
- Return type:
dict of float