earthkit.meteo.score.bootstrap¶
- earthkit.meteo.score.bootstrap(func: collections.abc.Callable[Ellipsis, ArrayLike], x: ArrayLike, *args: ArrayLike, dim: int | list[int] = 0, out_dim: int = 0, n_iter: int = 100, n_samples: int | None = None, replace: bool = True, rng: numpy.random.Generator | None = None, **kwargs) ArrayLike¶
- earthkit.meteo.score.bootstrap(func: collections.abc.Callable[Ellipsis, xarray.DataArray], *args: xarray.DataArray, dim: str = None, out_dim: str = 'sample', n_iter: int = 100, n_samples: int | None = None, replace: bool = True, rng: numpy.random.Generator | None = None, **kwargs) xarray.DataArray
Run bootstrapping.
- Parameters:
func (
function ((array,...,**kwargs) -> array)) – Function to bootstrapx (
xarray objectorarray-like) – Inputs tofunction, sampled for bootstrapping. Must have the same size alongdim*args (
xarray objectorarray-like) – Inputs tofunction, sampled for bootstrapping. Must have the same size alongdimdim (
strorintorlistofint) – Sample along this dimension (name or index/indices for array-like)out_dim (
strorint) – Output dimension name (or index for array-like) for samplesn_iter (
int) – Number of bootstrapping iterationsn_samples (
intorNone) – Number of samples for each iteration. If None, use the number of inputs (size ofxalong the sampling dimension)replace (
bool) – Sample with replacement (on by default)rng (
numpy.random.Generator) – Random number generator**kwargs – Additional keyword arguments to
func
- Returns:
Aggregated results of the bootstrapping process
- Return type:
xarray objectorarray-like