derivative

Optimal numerical differentiation of noisy time series data in python.

https://github.com/andgoldschmidt/derivative

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 8 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.1%) to scientific vocabulary

Keywords

differentiation experimental-data numerical-differentiation

Keywords from Contributors

interactive serializer packaging quantum-optimal-control network-simulation shellcodes hacking autograding observability genomics
Last synced: 6 months ago · JSON representation

Repository

Optimal numerical differentiation of noisy time series data in python.

Basic Info
Statistics
  • Stars: 64
  • Watchers: 4
  • Forks: 7
  • Open Issues: 4
  • Releases: 7
Topics
differentiation experimental-data numerical-differentiation
Created about 7 years ago · Last pushed 8 months ago
Metadata Files
Readme License

README.rst

|RTD| |PyPI| |Zenodo| |GithubCI| |LIC|

Numerical differentiation of noisy time series data in python
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

**derivative** is a Python package for differentiating noisy data. The package showcases a variety of improvements that can be made over finite differences when data is not clean.

Want to see an example of how **derivative** can help? This package is part of **PySINDy** (`github.com/dynamicslab/pysindy `_), a sparse-regression framework for discovering nonlinear dynamical systems from data.

This package binds common differentiation methods to a single easily implemented differentiation interface to encourage user adaptation.
Numerical differentiation methods for noisy time series data in python includes:

1. Symmetric finite difference schemes using arbitrary window size.

2. Savitzky-Galoy derivatives (aka polynomial-filtered 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.

6. Kalman derivatives find the maximum likelihood estimator for a derivative described by a Brownian motion.

7. Kernel derivatives smooth a random process defined by its kernel (covariance).

.. code-block:: python

    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)

    # 6. Kalman derivative with smoothing set to 1
    result6 = dxdt(x, t, kind="kalman", alpha=1)
    
    # 7. Kernel derivative with smoothing set to 1
    result7 = dxdt(x, t, kind="kernel", sigma=1, lmbd=.1, kernel="rbf")

Contributors:
-------------
Thanks to the members of the community who have contributed!

+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+
|`Jacob Stevens-Haas `_    | Kalman derivatives `#12 `_, |
|                                                                 | and more!                                                                         |
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+


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

[4] A Kernel Approach for PDE Discovery and Operator Learning - D. Long et al.


Citing derivative:
------------------
The **derivative** package is a contribution to `PySINDy `_; this work has been published in the Journal of Open Source Software (JOSS). If you use **derivative** in your work, please cite it using the following reference:

Kaptanoglu et al., (2022). PySINDy: A comprehensive Python package for robust sparse system identification. Journal of Open Source Software, 7(69), 3994, https://doi.org/10.21105/joss.03994

.. code-block:: text

	@article{kaptanoglu2022pysindy,
		doi = {10.21105/joss.03994},
		url = {https://doi.org/10.21105/joss.03994},
		year = {2022},
		publisher = {The Open Journal},
		volume = {7},
		number = {69},
		pages = {3994},
		author = {Alan A. Kaptanoglu and Brian M. de Silva and Urban Fasel and Kadierdan Kaheman and Andy J. Goldschmidt and Jared Callaham and Charles B. Delahunt and Zachary G. Nicolaou and Kathleen Champion and Jean-Christophe Loiseau and J. Nathan Kutz and Steven L. Brunton},
		title = {PySINDy: A comprehensive Python package for robust sparse system identification},
		journal = {Journal of Open Source Software}
		}
    

.. |RTD| image:: https://readthedocs.org/projects/derivative/badge/?version=latest
   :target: https://derivative.readthedocs.io/en/latest/?badge=latest
   :alt: Documentation Status
  
.. |LIC| image:: https://img.shields.io/badge/License-MIT-blue.svg
   :target: https://derivative.readthedocs.io/en/latest/license.html
   :alt: MIT License

.. |PyPI| image:: https://badge.fury.io/py/derivative.svg
    :target: https://pypi.org/project/derivative/

.. |Zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.6617446.svg
   :target: https://doi.org/10.5281/zenodo.6617446

.. |GithubCI| image:: https://github.com/andgoldschmidt/derivative/actions/workflows/push-test.yml/badge.svg
    :target: https://github.com/andgoldschmidt/derivative/actions/workflows/push-test.yml

Owner

  • Name: Andy Goldschmidt
  • Login: andgoldschmidt
  • Kind: user
  • Company: University of Chicago

EPiQC Postdoc with UChicago CS

GitHub Events

Total
  • Issues event: 3
  • Watch event: 7
  • Delete event: 2
  • Issue comment event: 18
  • Push event: 1
  • Pull request review comment event: 26
  • Pull request review event: 22
  • Pull request event: 2
  • Fork event: 1
  • Create event: 1
Last Year
  • Issues event: 3
  • Watch event: 7
  • Delete event: 2
  • Issue comment event: 18
  • Push event: 1
  • Pull request review comment event: 26
  • Pull request review event: 22
  • Pull request event: 2
  • Fork event: 1
  • Create event: 1

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 119
  • Total Committers: 5
  • Avg Commits per committer: 23.8
  • Development Distribution Score (DDS): 0.429
Past Year
  • Commits: 26
  • Committers: 3
  • Avg Commits per committer: 8.667
  • Development Distribution Score (DDS): 0.308
Top Committers
Name Email Commits
andy a****1@g****m 68
Jake Stevens-Haas j****s@g****m 22
Andy Goldschmidt a****1@g****m 21
Jake Stevens-Haas 3****s 7
dependabot[bot] 4****] 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 20
  • Total pull requests: 33
  • Average time to close issues: 4 months
  • Average time to close pull requests: about 2 months
  • Total issue authors: 7
  • Total pull request authors: 6
  • Average comments per issue: 2.3
  • Average comments per pull request: 1.06
  • Merged pull requests: 22
  • Bot issues: 0
  • Bot pull requests: 11
Past Year
  • Issues: 2
  • Pull requests: 2
  • Average time to close issues: 5 days
  • Average time to close pull requests: 3 months
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 6.5
  • Average comments per pull request: 3.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • andgoldschmidt (7)
  • Jacob-Stevens-Haas (7)
  • pavelkomarov (2)
  • yb6599 (1)
  • briandesilva (1)
  • moorepants (1)
  • jnahlers (1)
Pull Request Authors
  • Jacob-Stevens-Haas (19)
  • dependabot[bot] (12)
  • andgoldschmidt (4)
  • pavelkomarov (2)
  • yb6599 (2)
  • allen91wu (1)
Top Labels
Issue Labels
enhancement (5)
Pull Request Labels
dependencies (12)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 21,639 last-month
  • Total dependent packages: 7
    (may contain duplicates)
  • Total dependent repositories: 14
    (may contain duplicates)
  • Total versions: 18
  • Total maintainers: 2
pypi.org: derivative

Numerical differentiation in python.

  • Versions: 13
  • Dependent Packages: 6
  • Dependent Repositories: 14
  • Downloads: 21,639 Last month
Rankings
Dependent packages count: 1.6%
Downloads: 2.6%
Dependent repos count: 3.9%
Average: 6.1%
Stargazers count: 9.7%
Forks count: 12.5%
Maintainers (2)
Last synced: 6 months ago
conda-forge.org: derivative
  • Versions: 5
  • Dependent Packages: 1
  • Dependent Repositories: 0
Rankings
Dependent packages count: 28.8%
Dependent repos count: 34.0%
Average: 37.8%
Stargazers count: 40.7%
Forks count: 47.7%
Last synced: 6 months ago

Dependencies

pyproject.toml pypi
  • ipykernel ^5.2.1
  • jupyter_client ^6.1.3
  • matplotlib ^3.2.1
  • nbsphinx ^0.6.1
  • numpy ^1.18.3
  • pandoc ^2.2
  • pytest ^3.6.4
  • python ^3.7
  • scipy ^1.4.1
  • sklearn ^0.0
  • sphinx ^4.0.2
  • sphinx_rtd_theme ^0.4.3
.github/workflows/pull-docs.yml actions
  • actions/cache v4 composite
  • actions/checkout v4 composite
  • actions/setup-python v4 composite
  • nikeee/setup-pandoc v1 composite
.github/workflows/push-test.yml actions
  • actions/cache v4 composite
  • actions/checkout v4 composite
  • actions/setup-python v4 composite
  • snok/install-poetry v1 composite
.github/workflows/release.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v4 composite
  • snok/install-poetry v1 composite