interpolation

Interpolate 1D and 2D data using SciPy and Interpax.

1|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/yonesuke/skills --skill interpolation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: interpolation
Source: https://github.com/yonesuke/skills/tree/main/interpolation
Command: npx skills add https://github.com/yonesuke/skills --skill interpolation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jax, jaxlib, interpax, numpy, scipy, and includes scripts (resource) components.

What problem does it solve?

This skill provides reliable 1D and 2D data interpolation using SciPy on CPU and differentiable interpolation via JAX/Interpax on GPU, enabling smooth value estimation between samples.

Core Features & Use Cases

  • 1D interpolation using CubicSpline, PchipInterpolator, and linear extrapolation.
  • 2D grid interpolation using RegularGridInterpolator and griddata, plus support for scattered data interpolation.
  • Differentiable workflows via Interpax to enable gradient-based optimization in ML pipelines and simulations.

Quick Start

Run the SciPy/JAX interpolation demos to observe spline, monotonic, and differentiable interpolation on sample data.

Frequently Asked Questions about interpolation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I interpolate 1D data using SciPy cubic spline and PCHIP methods?

2D grid interpolation uses SciPy RegularGridInterpolator for structured grids and griddata for scattered points, estimating intermediate values across two-dimensional sample distributions. This enables accurate value estimation for spatial data and simulation workflows.

Can I use differentiable interpolation with JAX for gradient-based optimization?

Interpax integrates with JAX on GPU to provide differentiable interpolation, enabling gradient-based optimization workflows where interpolation parameters must be tuned via automatic differentiation. This bridges numerical interpolation with machine learning training loops.

What's the best way to interpolate scattered data points on a regular grid?

Scattered data interpolation is handled through SciPy griddata, which maps irregularly distributed sample points onto regular grids. RegularGridInterpolator covers structured 2D grids, providing accurate estimation for both scattered and gridded spatial distributions.

Does this interpolation approach work for both CPU-based SciPy and GPU-based JAX workflows?

The skill supports dual execution paths: SciPy-based interpolation runs on CPU for standard numerical analysis, while Interpax with JAX enables differentiable interpolation on GPU. This covers both traditional computation and ML-accelerated workflows.

When should I use PCHIP interpolation instead of a cubic spline for data smoothing?

PCHIP interpolation preserves monotonicity in data where cubic spline would introduce oscillations or overshoots, making it preferable for data that must remain monotonic between samples. Cubic spline suits general smooth interpolation when monotonicity is not a constraint.