earthkit.meteo.score.xarray.bootstrap

earthkit.meteo.score.xarray.bootstrap(func, *args, dim=None, out_dim='sample', n_iter=100, n_samples=None, replace=True, rng=None, **kwargs)

Run bootstrapping.

Parameters:
  • func (function ((array, ..., **kwargs) -> array)) – Function to bootstrap

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

  • dim (str) – Sample along this dimension

  • out_dim (str) – Output dimension name 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 the first array 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