Theory: Numerical Calculus for Real Systems
“We cannot compute exact derivatives from data. But by approximating the underlying system, we transform an intractable problem into a tractable one.”
The Central Thesis
Every physical, biological, financial, and engineered system evolves according to some underlying dynamics—equations of motion we rarely know exactly. What we have instead are discrete, noisy observations.
PyDelt’s approach: Fit a differentiable surrogate to the data. The surrogate yields to standard calculus tools, giving us approximate derivatives with quantifiable error.
This documentation teaches you:
Why exact derivatives are impossible from discrete, noisy data
How approximation methods work and when they fail
How to quantify and control error in derivative estimates
How to apply these tools across domains
Who This Is For
Data scientists who know basic calculus but need numerical methods
Engineers working with sensor data and dynamical systems
Researchers in physics, biology, or finance dealing with noisy observations
ML practitioners who want to understand gradients beyond autodiff
We assume you’ve completed undergraduate calculus (derivatives, integrals, chain rule). We’ll introduce multivariate calculus, numerical analysis, and stochastic processes as needed.
Chapters
Part I: Foundations
Chapter |
Topic |
Key Question |
|---|---|---|
The Approximation Paradigm |
Why can’t we compute exact derivatives? |
|
Finite Differences |
How do classical methods work and fail? |
|
Bias-Variance Tradeoff |
How do we handle noisy data? |
|
Surrogates |
What functions can we fit? |
Part II: Extensions
Chapter |
Topic |
Key Question |
|---|---|---|
Gradients, Jacobians, Hessians |
How do we handle multiple dimensions? |
|
Error Bounds |
When does approximation work? |
|
System Identification |
How do we discover dynamics from data? |
|
SDEs and Itô |
What about random systems? |
Part III: Practice
Chapter |
Topic |
Key Question |
|---|---|---|
Real-World Use Cases |
How do we apply this under error? |
|
References |
Where can I learn more? |
The Narrative Arc
Chapter 0: Sets up the central problem—we observe systems but don’t know their equations.
Chapters 1-3: Build the toolkit—finite differences fail on noise, smoothing helps but biases, interpolation creates differentiable surrogates.
Chapters 4-5: Extend to harder problems—multiple dimensions, theoretical guarantees.
Chapters 6-7: Handle dynamics—ODEs from data, stochastic systems that break classical calculus.
Chapter 8: Apply to real domains—sensors, finance, physics, ML—each with its own error sources.
Quick Reference
PyDelt’s Core Pattern
from pydelt.interpolation import SplineInterpolator
# 1. Create interpolator with smoothing
interp = SplineInterpolator(smoothing=0.1)
# 2. Fit to data
interp.fit(time_data, signal_data)
# 3. Get derivative function
derivative = interp.differentiate(order=1)
# 4. Evaluate anywhere
dy_dt = derivative(query_points)
Method Selection Guide
Scenario |
Method |
Smoothing |
|---|---|---|
Low noise, smooth function |
Spline |
Low (0.01-0.1) |
Moderate noise |
Spline |
Medium (0.1-1.0) |
High noise |
LOWESS |
frac=0.1-0.3 |
Outliers present |
LOWESS |
Robust by default |
Complex patterns |
Neural Network |
Architecture-dependent |
Stochastic system |
Estimate drift/diffusion |
Heavy smoothing |
Error Scaling
Quantity |
Error Scaling |
Notes |
|---|---|---|
Function value |
O(n^{-4/5}) |
For C² functions, optimal |
First derivative |
O(n^{-3/5}) |
One order worse |
Second derivative |
O(n^{-2/5}) |
Two orders worse |
Noise amplification |
O(1/h) |
Smaller step = more noise |
Learning Paths
Quick Start (2 hours)
For those who need to use PyDelt now:
Introduction — 15 min
Interpolation Methods — 45 min
Applications — 60 min
Standard Path (8-10 hours)
For solid understanding:
Work through chapters 0-5 in order
Skim 6-7 based on your domain
Study 8 for your application area
Deep Dive (20+ hours)
For mastery:
All chapters with exercises
Implement methods from scratch
Read bibliography references
Apply to your own data
Prerequisites Assumed
Calculus: Derivatives, integrals, chain rule, Taylor series
Linear Algebra: Vectors, matrices, eigenvalues
Statistics: Mean, variance, Gaussian distribution
Python: NumPy, basic plotting
Concepts Introduced
Numerical Analysis: Truncation error, rounding error, stability
Multivariate Calculus: Gradients, Jacobians, Hessians
Approximation Theory: Function spaces, convergence rates
Stochastic Processes: Brownian motion, Itô calculus
System Identification: ODEs from data, SINDy
Start your journey: Introduction →