NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

DataInterpolations.jl: Fast Interpolations of 1D data

Sathvik Bhagavan, Bart de Koning, Shubham Maddhashiya, Christopher RackauckasJ. Open Source Softw 2024 · DBLP

Overview

DataInterpolations.jl is a high-performance Julia library designed to transform discrete 1D data points into continuous, differentiable functions. It serves as a comprehensive "one-stop-shop" for a wide array of interpolation methods—ranging from simple linear fits to complex B-splines—while maintaining full compatibility with Julia's symbolic modeling and automatic differentiation (AD) ecosystems.

Addressing the Gap in 1D Interpolation

In scientific computing and machine learning, researchers frequently work with "sampled" data—discrete measurements taken at specific intervals. Converting these points into a continuous function is essential for simulations, differential equations, and optimization tasks.

While the Julia ecosystem previously offered various interpolation tools, they were often fragmented. For example, the popular Interpolations.jl primarily focuses on B-splines and uniform grids, while other packages are highly specialized for single methods like Chebyshev or PCHIP. DataInterpolations.jl was developed to provide a library that is:

  1. Generic: Capable of handling arbitrarily spaced (non-uniform) data without assuming a specific structure.
  2. Comprehensive: Offering a diverse suite of methods (Lagrange, Akima, etc.) under a unified interface.
  3. Integrated: Optimized for modern "Scientific Machine Learning" (SciML) tools, including symbolic math and automatic differentiation.

Methodology and Implementation

The package implements a broad suite of 1D interpolation techniques, categorized as follows:

  • Basic Methods: Constant, Linear, Quadratic, and Lagrange interpolation.
  • Splines: Quadratic, Cubic, Akima, Cubic Hermite, PCHIP, Quintic Hermite, and B-Splines.
  • Smoothing & Fitting: Regression-based B-splines and Tikhonov regularization, which are particularly effective for noisy datasets.

Beyond standard point evaluation, the library provides built-in functionality to compute integrals and derivatives (up to the second order) for these interpolations. A key technical advantage is its "AD-friendly" design, allowing users to seamlessly take gradients through interpolations within larger optimization or machine learning loops. Furthermore, integration with Symbolics.jl enables these interpolations to be embedded directly into equation-based models via ModelingToolkit.jl.

Key Insights: Performance and Synergy

Algorithmic Efficiency

Performance in DataInterpolations.jl is achieved through both low-level optimization and superior algorithms. The package utilizes specialized caching and "quasi-linear guessing" to accelerate the search for data points during evaluation, significantly outperforming standard implementations on large datasets.

Unified Interface

The library's consistent API allows researchers to swap interpolation methods (e.g., transitioning from a linear fit to an Akima spline) with a single line of code. This flexibility facilitates rapid model benchmarking and experimentation.

Ecosystem Synergy

As a core component of the SciML ecosystem, the package allows interpolations to become first-class citizens in complex systems of differential equations. This is a critical requirement for modern engineering applications and Physics-Informed Neural Networks (PINNs).

Results and Versatility

DataInterpolations.jl stands out as a flexible alternative to existing Julia packages by offering:

  • Greater Versatility: It supports methods like Lagrange and Quadratic interpolation that are often missing in other major libraries.
  • Calculus Support: It provides a complete suite for derivatives and integrals of interpolation objects.
  • Ease of Use: Complex operations, such as defining a Cubic Spline and evaluating its derivative, are reduced to a few lines of highly readable code.

Limitations and Future Directions

Currently, the library focuses exclusively on 1D data. While 1D is the primary use case for time-series and sensor data, multi-dimensional manifolds are not yet supported. The authors intend to expand the list of supported methods, aiming for DataInterpolations.jl to become the definitive reference implementation for all 1D interpolation needs in the Julia language.

Summary updated

BibTeX
@article{bhagavan2024datainterpolations,
  author = {Sathvik Bhagavan and Bart de Koning and Shubham Maddhashiya and Christopher Rackauckas and Sathvik Bhagavan and Bart de Koning and Christopher Vincent Rackauckas and Shubham Maddhashiya},
  title = {{DataInterpolations.jl: Fast Interpolations of 1D data}},
  journal = {J. Open Source Softw.},
  year = {2024},
  doi = {10.21105/joss.06917},
}
Figure