fips.kernels.GridTimeDecay#

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

Create a grid temporal decay kernel.

Parameters:
  • scale (str or pd.Timedelta) – Scale parameter for the decay function. If a string is provided, it will be converted to a pd.Timedelta.

  • 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 temporal decay matrix based on the specified scale, treating all time points as part of a single grid (i.e., not grouped by any time dimension).

Return type:

function