deerlab.regoperator

regoperator(r, d=2, includeedges=False)[source]

Computes the discrete approximation to the derivative operators used as regularization operators.

Parameters:
rarray_like with shape(n,)

An array of distances, in nanometers

dint scalar, optional

Derivative order, the default is 2.

includeedgesboolean, optional

Determines whether the first and last point of the distance range are included in the derivative. The default is False.

Returns:
Lndarray with shape(n-2,n)

Regularization operator (or finite-difference derivative operator).

Notes

All finite-difference matrix elements are computed via Fornberg’s method [1]. Therefore, the resulting operator is agnostic with respect to the increments in the distance vector, allowing uniformly as well as non-uniformly spaced distance vectors.

References

[1]
  1. Fornberg, “Calculation of weights in finite difference formulas”, SIAM Review 40 (1998), pp. 685-691.