runtraj.meteorology.fit_variogram#

runtraj.meteorology.fit_variogram(lag, gamma, *, sigma=None)[source]#

Fit an exponential variogram to an empirical one.

Parameters:
  • lag (ArrayLike) – The empirical variogram, as returned by variogram().

  • gamma (ArrayLike) – The empirical variogram, as returned by variogram().

  • sigma (float | None) – Error standard deviation. When given, the sill is fixed at sigma² and only the correlation scale is fitted, as Lin and Gerbig’s definition implies. Use it when the sample standard deviation is known. None fits both.

Return type:

VariogramFit

Notes

The model has no nugget, and the fit is unweighted least squares on the bins, whatever the number of pairs in each. Noise in the errors adds a variance that stays at small separations, which the model cannot hold, so with sigma fixed at the sample standard deviation the fitted length comes out too short. In a test with a true length of 450 m, noise that was 20% of the variance gave about 330 m.