derivative


Namederivative JSON
Version 0.6.0 PyPI version JSON
download
home_pagehttps://github.com/andgoldschmidt/derivative
SummaryNumerical differentiation in python.
upload_time2023-05-06 17:44:37
maintainer
docs_urlNone
authorAndy Goldschmidt
requires_python>=3.7,<4.0
licenseMIT
keywords differentiation derivative gradient prime
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            |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 <https://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 <https://github.com/Jacob-Stevens-Haas>`_  | Kalman derivatives `#12 <https://github.com/andgoldschmidt/derivative/pull/12>`_,|
|								  | Kernel derivatives `#30 <https://github.com/andgoldschmidt/derivative/pull/30>`_ |  
+-----------------------------------------------------------------+----------------------------------------------------------------------------------+


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 <https://github.com/dynamicslab/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


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/andgoldschmidt/derivative",
    "name": "derivative",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7,<4.0",
    "maintainer_email": "",
    "keywords": "differentiation,derivative,gradient,prime",
    "author": "Andy Goldschmidt",
    "author_email": "andygold@uchicago.edu",
    "download_url": "https://files.pythonhosted.org/packages/f0/37/43116503aa6b6b7dcf6786ed7f9e557b0558d08124a0c018335395b7d8df/derivative-0.6.0.tar.gz",
    "platform": null,
    "description": "|RTD| |PyPI| |Zenodo| |GithubCI| |LIC|\n\nNumerical differentiation of noisy time series data in python\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n**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.\n\nWant to see an example of how **derivative** can help? This package is part of **PySINDy** (`github.com/dynamicslab/pysindy <https://github.com/dynamicslab/pysindy/>`_), a sparse-regression framework for discovering nonlinear dynamical systems from data.\n\nThis package binds common differentiation methods to a single easily implemented differentiation interface to encourage user adaptation.\nNumerical differentiation methods for noisy time series data in python includes:\n\n1. Symmetric finite difference schemes using arbitrary window size.\n\n2. Savitzky-Galoy derivatives (aka polynomial-filtered derivatives) of any polynomial order with independent left and right window parameters.\n\n3. Spectral derivatives with optional filter.\n\n4. Spline derivatives of any order.\n\n5. Polynomial-trend-filtered derivatives generalizing methods like total variational derivatives.\n\n6. Kalman derivatives find the maximum likelihood estimator for a derivative described by a Brownian motion.\n\n7. Kernel derivatives smooth a random process defined by its kernel (covariance).\n\n.. code-block:: python\n\n    from derivative import dxdt\n    import numpy as np\n\n    t = np.linspace(0,2*np.pi,50)\n    x = np.sin(x)\n\n    # 1. Finite differences with central differencing using 3 points.\n    result1 = dxdt(x, t, kind=\"finite_difference\", k=1)\n\n    # 2. Savitzky-Golay using cubic polynomials to fit in a centered window of length 1\n    result2 = dxdt(x, t, kind=\"savitzky_golay\", left=.5, right=.5, order=3)\n\n    # 3. Spectral derivative\n    result3 = dxdt(x, t, kind=\"spectral\")\n\n    # 4. Spline derivative with smoothing set to 0.01\n    result4 = dxdt(x, t, kind=\"spline\", s=1e-2)\n\n    # 5. Total variational derivative with regularization set to 0.01\n    result5 = dxdt(x, t, kind=\"trend_filtered\", order=0, alpha=1e-2)\n\n    # 6. Kalman derivative with smoothing set to 1\n    result6 = dxdt(x, t, kind=\"kalman\", alpha=1)\n    \n    # 7. Kernel derivative with smoothing set to 1\n    result7 = dxdt(x, t, kind=\"kernel\", sigma=1, lmbd=.1, kernel=\"rbf\")\n\nContributors:\n-------------\nThanks to the members of the community who have contributed!\n\n+-----------------------------------------------------------------+----------------------------------------------------------------------------------+\n|  `Jacob Stevens-Haas <https://github.com/Jacob-Stevens-Haas>`_  | Kalman derivatives `#12 <https://github.com/andgoldschmidt/derivative/pull/12>`_,|\n|\t\t\t\t\t\t\t\t  | Kernel derivatives `#30 <https://github.com/andgoldschmidt/derivative/pull/30>`_ |  \n+-----------------------------------------------------------------+----------------------------------------------------------------------------------+\n\n\nReferences:\n-----------\n\n[1] Numerical differentiation of experimental data: local versus global methods- K. Ahnert and M. Abel\n\n[2] Numerical Differentiation of Noisy, Nonsmooth Data- Rick Chartrand\n\n[3] The Solution Path of the Generalized LASSO- R.J. Tibshirani and J. Taylor\n\n[4] A Kernel Approach for PDE Discovery and Operator Learning - D. Long et al.\n\n\nCiting derivative:\n------------------\nThe **derivative** package is a contribution to `PySINDy <https://github.com/dynamicslab/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:\n\nKaptanoglu 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\n\n.. code-block:: text\n\n      @article{kaptanoglu2022pysindy,\n  \tdoi = {10.21105/joss.03994},\n  \turl = {https://doi.org/10.21105/joss.03994},\n  \tyear = {2022},\n  \tpublisher = {The Open Journal},\n  \tvolume = {7},\n  \tnumber = {69},\n  \tpages = {3994},\n  \tauthor = {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},\n  \ttitle = {PySINDy: A comprehensive Python package for robust sparse system identification},\n  \tjournal = {Journal of Open Source Software}\n\t}\n    \n\n.. |RTD| image:: https://readthedocs.org/projects/derivative/badge/?version=latest\n   :target: https://derivative.readthedocs.io/en/latest/?badge=latest\n   :alt: Documentation Status\n  \n.. |LIC| image:: https://img.shields.io/badge/License-MIT-blue.svg\n   :target: https://derivative.readthedocs.io/en/latest/license.html\n   :alt: MIT License\n\n.. |PyPI| image:: https://badge.fury.io/py/derivative.svg\n    :target: https://pypi.org/project/derivative/\n\n.. |Zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.6617446.svg\n   :target: https://doi.org/10.5281/zenodo.6617446\n\n.. |GithubCI| image:: https://github.com/andgoldschmidt/derivative/actions/workflows/push-test.yml/badge.svg\n    :target: https://github.com/andgoldschmidt/derivative/actions/workflows/push-test.yml\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Numerical differentiation in python.",
    "version": "0.6.0",
    "project_urls": {
        "Documentation": "https://derivative.readthedocs.io/",
        "Homepage": "https://github.com/andgoldschmidt/derivative",
        "Repository": "https://github.com/andgoldschmidt/derivative"
    },
    "split_keywords": [
        "differentiation",
        "derivative",
        "gradient",
        "prime"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "66b614fc2d8685291c0c348d13ed941486804152b48d055517f36ec731dfe1a4",
                "md5": "5b54fdfa0081327187bf9bcbba6d663e",
                "sha256": "94f1dc98f87c0454700717fc89ba7ac46244f402de12f4a9f5873b114c61c33b"
            },
            "downloads": -1,
            "filename": "derivative-0.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5b54fdfa0081327187bf9bcbba6d663e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<4.0",
            "size": 14106,
            "upload_time": "2023-05-06T17:44:35",
            "upload_time_iso_8601": "2023-05-06T17:44:35.894203Z",
            "url": "https://files.pythonhosted.org/packages/66/b6/14fc2d8685291c0c348d13ed941486804152b48d055517f36ec731dfe1a4/derivative-0.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f03743116503aa6b6b7dcf6786ed7f9e557b0558d08124a0c018335395b7d8df",
                "md5": "8475fc902c6f0d1668dcaeeec31c0061",
                "sha256": "31101ea2b1d6ae62b1af48845de27fac432eb76541ff0ae4355e72b48b6d0a54"
            },
            "downloads": -1,
            "filename": "derivative-0.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "8475fc902c6f0d1668dcaeeec31c0061",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<4.0",
            "size": 14642,
            "upload_time": "2023-05-06T17:44:37",
            "upload_time_iso_8601": "2023-05-06T17:44:37.639567Z",
            "url": "https://files.pythonhosted.org/packages/f0/37/43116503aa6b6b7dcf6786ed7f9e557b0558d08124a0c018335395b7d8df/derivative-0.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-06 17:44:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "andgoldschmidt",
    "github_project": "derivative",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "derivative"
}
        
Elapsed time: 0.10783s