Expand description
Helper functions for numerical integration and common operations.
Enums§
- Interpolation
Method - Interpolation method for resampling functional data.
Constants§
- DEFAULT_
CONVERGENCE_ TOL - Default convergence tolerance for iterative algorithms.
- NUMERICAL_
EPS - Small epsilon for numerical comparisons (e.g., avoiding division by zero).
Functions§
- aic
- Compute AIC from residual sum of squares.
- bandwidth_
candidates_ from_ dists - Extract bandwidth candidates from a flat n×n distance matrix.
- bic
- Compute BIC from residual sum of squares.
- cumulative_
trapz - Cumulative integration using Simpson’s rule where possible.
- extract_
curves - Extract curves from column-major data matrix.
- fdata_
interpolate - Interpolate functional data to a new grid.
- gaussian_
kernel - Gaussian kernel: K(d, h) = exp(-d² / (2h²)).
- gradient
- Numerical gradient that auto-detects uniform vs non-uniform grids.
- gradient_
nonuniform - Numerical gradient for non-uniform grids using 3-point Lagrange derivative.
- gradient_
uniform - Numerical gradient with uniform spacing using 5-point stencil (O(h⁴)).
- l2_
distance - Compute L2 distance between two curves using integration weights.
- linear_
interp - Linear interpolation at point
tusing binary search. - quantile_
sorted - Compute a quantile from a sorted slice.
- r_
squared - Compute R² (coefficient of determination).
- r_
squared_ adj - Compute adjusted R².
- simpsons_
weights - Compute Simpson’s 1/3 rule integration weights for a grid.
- simpsons_
weights_ 2d - Compute 2D integration weights using tensor product of 1D weights.
- sort_
nan_ safe - Sort a slice using total ordering that treats NaN as equal.
- trapz
- Trapezoidal integration of
yoverx.