discrete_convolution_with_exponential#
- petpal.kinetic_modeling.tcms_as_convolutions.discrete_convolution_with_exponential(func_times: numpy.ndarray, func_vals: numpy.ndarray, k1: float, k2: float)#
Computes the convolution of the given function with an exponential kernel.
Given the provided function \(u(t)\), sampled evenly with respect to time, we calculate \(c(t) = k_{1} \exp(-k_{2} t) \otimes u(t)\) where \(\otimes\) represents the convolution operator. This implementation is \(\mathcal{O}(N)\) due to the simple recurrence relationship arising from an exponential kernel. This implementation is based heavily on the KMAPLIB implementation
Important
The function assumes that the times are evenly sampled. Answers will be incorrect if this is not the case.
- Parameters:
func_vals (np.ndarray) – Array containing function values for \(t\geq0\). Assumed to be evenly sampled with respect to \(t\).
func_times (np.ndarray) – Array containing time-points where \(t\geq0\). Assumed to be evenly sampled with respect to \(t\).
k1 (float) – Rate constant for transport from first tissue compartment.
k2 (float) – Rate constant for transport from second tissue compartment.
- Returns:
(np.ndarray) – Array containing the convolution of an exponential function with the provided function.
See also
calc_convolution_with_check()for a more general convolution function