code: def spherical_variogram_model(m, d):
      
      psill = float(m[0])
      range_ = float(m[1])
      nugget = float(m[2])
      return np.piecewise(d, [d <= range_, d > range_],
                          [lambda x: psill * ((3.*x)/(2.*range_) - (x**3.)/(2.*range_**3.)) + nugget, psill + nugget])
docs: Spherical model, m is [psill, range, nugget]