mesmer.stats.predict_harmonic_model

mesmer.stats.predict_harmonic_model#

mesmer.stats.predict_harmonic_model(yearly_predictor, coeffs, time, time_dim='time')#

construct a Fourier Series from yearly predictors with fitted coeffs.

Parameters:
  • yearly_predictor (xr.DataArray) – yearly values used as predictors, must contain time_dim but can have additional dimensions for example gridcells or members.

  • coeffs (xr.DataArray) – coefficients of Fourier Series, must have “coeff” dim and additional dims of yearly_predictor. Note that coeffs may contain nans (for higher orders, that have not been fit).

  • time (xr.DataArray) – A xr.DataArray containing cftime objects which will be used as coordinates for the monthly output values

  • time_dim (str, default: “time”) – Name of the time dimension on yearly_predictor. Will also be the name of the time_dim of the output xr.DataArray.

Returns:

predictions (xr.DataArray) – Fourier Series calculated over yearly_predictor with coeffs, has time_dim with values of time and any additional dimensions of yearly_predictor.