Skip to main content

Numerical differentiation in python.

## Project description  ## Numerical differentiation of noisy time series data in python

Numerical differentiation methods for noisy time series data in python includes:

```from derivative import dxdt
import numpy as np

t = np.linspace(0,2*np.pi,50)
x = np.sin(x)

# 1. Finite differences with central differencing using 3 points.
result1 = dxdt(x, t, kind="finite_difference", k=1)

# 2. Savitzky-Golay using cubic polynomials to fit in a centered window of length 1
result2 = dxdt(x, t, kind="savitzky_golay", left=.5, right=.5, order=3)

# 3. Spectral derivative
result3 = dxdt(x, t, kind="spectral")

# 4. Spline derivative with smoothing set to 0.01
result4 = dxdt(x, t, kind="spline", s=1e-2)

# 5. Total variational derivative with regularization set to 0.01
result5 = dxdt(x, t, kind="trend_filtered", order=0, alpha=1e-2)
```
1. Symmetric finite difference schemes using arbitrary window size.
2. Savitzky-Galoy derivatives of any polynomial order with independent left and right window parameters.
3. Spectral derivatives with optional filter.
4. Spline derivatives of any order.
5. Polynomial-trend-filtered derivatives generalizing methods like total variational derivatives.

The goal of this package is to provide some common numerical differentiation techniques that showcase improvements that can be made on finite differences when data is noisy.

This package binds these common differentiation methods to a single easily implemented differentiation interface to encourage user adaptation.

## Release history Release notifications | RSS feed

This version 0.3.1 0.3.0 0.2.0 0.1.2 0.1.0

## Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for derivative, version 0.3.1
Filename, size File type Python version Upload date Hashes
Filename, size derivative-0.3.1-py3-none-any.whl (10.6 kB) File type Wheel Python version py3 Upload date Hashes
Filename, size derivative-0.3.1.tar.gz (10.1 kB) File type Source Python version None Upload date Hashes