|
High-performance radial basis function interpolation |
RBF methods approximate functions from scattered data without requiring a mesh. This package focuses on local collocation — building stencils from k-nearest neighbors instead of coupling all N points — so it scales to large problems without dense N×N solves.
Beyond interpolation, it provides differential operators (Laplacian, gradient, partials, custom) that act directly on scattered data, with support for Hermite interpolation to enforce boundary conditions in PDE applications.
Other things that might matter to you:
- GPU evaluation support via Adapt.jl — build on CPU, evaluate on GPU (full GPU tracking issue)
- Native autodiff rules for Enzyme.jl and Mooncake.jl (no generic fallbacks)
- Operator algebra — combine operators with
+,-,*
Scattered data points (left) reconstructed as a smooth surface using RBF interpolation (right)
using RadialBasisFunctions, StaticArrays
# Scattered 2D points — no mesh needed
points = [SVector{2}(rand(2)) for _ in 1:500]
f(x) = sin(4x[1]) * cos(3x[2])
values = f.(points)
# Interpolation
interp = Interpolator(points, values)
interp(SVector(0.5, 0.5))
# Differential operators on scattered data
∇² = laplacian(points)
∇ = gradient(points)
∂x = partial(points, 1, 1) # ∂/∂x₁
∂²y = partial(points, 2, 2) # ∂²/∂x₂²
∇²(values) # apply to data
∇(values) # Nx2 matrix
# Combine operators
mixed = ∂x + ∂²y # operator algebra
# Transfer data between point sets
target = [SVector{2}(rand(2)) for _ in 1:1000]
rg = regrid(points, target)
rg(values) # interpolated onto target| Type | Formula | Best For |
|---|---|---|
| Polyharmonic Spline (PHS) |
|
General purpose, no shape parameter tuning |
| Inverse Multiquadric (IMQ) | Smooth interpolation with tunable accuracy | |
| Gaussian | Infinitely smooth functions |
using Pkg
Pkg.add("RadialBasisFunctions")Requires Julia 1.10 or later.
Tip
The examples above use sensible defaults (PHS(3) basis, quadratic polynomial augmentation, auto-selected stencil size). All of these are configurable — see the Getting Started guide for details on choosing a basis function, stencil size (k), polynomial degree, Hermite boundary conditions, and more.
- Getting Started — tutorials covering interpolation, operators, and boundary conditions
- Autodiff — differentiating through operators with Enzyme and Mooncake
- Theory — mathematical background on RBF methods
- API Reference — full function documentation
If you use RadialBasisFunctions.jl in your research, please cite:
@software{RadialBasisFunctions_jl,
author = {Beggs, Kyle},
title = {RadialBasisFunctions.jl: Meshless RBF interpolation and differential operators for Julia},
url = {https://github.com/JuliaMeshless/RadialBasisFunctions.jl},
doi = {10.5281/zenodo.7941390}
}Contributions are welcome! Please feel free to:
- Report bugs or request features on GitHub Issues
- Start a discussion on GitHub Discussions
- Submit pull requests
Part of the JuliaMeshless organization.
