Skip to main content

Numerical differentiation in python.

Project description

Documentation Status MIT License

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.

References:

[1] Numerical differentiation of experimental data: local versus global methods- K. Ahnert and M. Abel

[2] Numerical Differentiation of Noisy, Nonsmooth Data- Rick Chartrand

[3] The Solution Path of the Generalized LASSO- R.J. Tibshirani and J. Taylor

Project details


Download files

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

Source Distribution

derivative-0.3.1.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

derivative-0.3.1-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file derivative-0.3.1.tar.gz.

File metadata

  • Download URL: derivative-0.3.1.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.6 Linux/4.15.0-118-generic

File hashes

Hashes for derivative-0.3.1.tar.gz
Algorithm Hash digest
SHA256 2cbb155e6dbf593c026267da56162719644c0279459502e843f01c4d1d884802
MD5 6886f97c19cbfeb45f457a881f3d23da
BLAKE2b-256 e0f1e9061edfb9b7cbdb2628b7d4b3ebabc5f2d7dd0f7721de42495073c47e93

See more details on using hashes here.

File details

Details for the file derivative-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: derivative-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.6 Linux/4.15.0-118-generic

File hashes

Hashes for derivative-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aa8746039b275b1e796633647b3a3c5ee37f170356f885363914b7f63acb2ab2
MD5 9ae8b653d843d3c5750ac1268b549056
BLAKE2b-256 906663a42a4c717fbfb66d8507c2cf20de43c4b1f91f5bff27bca7066b7cd597

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page