xoa.stats.rms

Contents

xoa.stats.rms#

xoa.stats.rms(da, ref=None, mask=None, dim=None, by=None)[source]#

Compute a root mean square, or a root mean square error

Parameters:
  • da (xarray.DataArray) – Estimate, or the error when ref is not provided.

  • ref (None, xarray.DataArray) – Reference, which is subtracted from da.

  • mask (None, xarray.DataArray) – Boolean array that tells where to compute the statistics. Missing values are always discarded.

  • dim (None, str, list(str)) – Dimensions to reduce, which default to all of them.

  • by (None, dict) – Regions as a dict that maps names to boolean arrays. The root mean square is then computed in each of them, in addition to mask, and the result has an extra region dimension.

Returns:

xarray.DataArray

Example

rms(rossby_z, ref=rossby_ref, mask=valid)
rms(speed_error, by={"Everywhere": valid, "Cores": valid & core})