fips.kernels.GridSpatialDecay#

fips.kernels.GridSpatialDecay(lat_dim, lon_dim, scale, decay_func=<function _exponential_decay>)[source]#

Create a grid spatial decay kernel (Haversine).

Parameters:
  • lat_dim (str) – Name of the latitude dimension in the input DataFrame.

  • lon_dim (str) – Name of the longitude dimension in the input DataFrame.

  • scale (float) – Scale parameter for the decay function, in the same units as the distance matrix (e.g., kilometers if using Haversine distance).

  • decay_func (callable, optional) – A function that takes a distance matrix and a scale parameter and returns a decay matrix. Defaults to the exponential decay function.

Returns:

A kernel function that can be applied to a DataFrame to compute the spatial decay matrix based on the specified latitude and longitude dimensions and scale, using Haversine distance for spatial separation.

Return type:

function