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 bootstrap

  • x (xarray object or array-like) – Inputs to function, sampled for bootstrapping. Must have the same size along dim

  • *args (xarray object or array-like) – Inputs to function, sampled for bootstrapping. Must have the same size along dim

  • dim (str or int or list of int) – Sample along this dimension (name or index/indices for array-like)

  • out_dim (str or int) – Output dimension name (or index for array-like) for samples

  • n_iter (int) – Number of bootstrapping iterations

  • n_samples (int or None) – Number of samples for each iteration. If None, use the number of inputs (size of x along 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 object or array-like