resample


Nameresample JSON
Version 1.10.0 PyPI version JSON
download
home_pageNone
SummaryResampling-based inference in Python
upload_time2024-06-21 17:16:08
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseBSD-3-Clause
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            .. |resample| image:: doc/_static/logo.svg
   :alt: resample
   :target: http://resample.readthedocs.io

|resample|
==========

.. image:: https://img.shields.io/pypi/v/resample.svg
   :target: https://pypi.org/project/resample
.. image:: https://img.shields.io/conda/vn/conda-forge/resample.svg
   :target: https://github.com/conda-forge/resample-feedstock
.. image:: https://github.com/resample-project/resample/actions/workflows/test.yml/badge.svg
   :target: https://github.com/resample-project/resample/actions/workflows/tests.yml
.. image:: https://coveralls.io/repos/github/resample-project/resample/badge.svg
   :target: https://coveralls.io/github/resample-project/resample
.. image:: https://readthedocs.org/projects/resample/badge/?version=stable
   :target: https://resample.readthedocs.io/en/stable
.. image:: https://img.shields.io/pypi/l/resample
   :target: https://pypi.org/project/resample
.. image:: https://zenodo.org/badge/145776396.svg
   :target: https://zenodo.org/badge/latestdoi/145776396

`Link to full documentation`_

.. _Link to full documentation: http://resample.readthedocs.io

.. skip-marker-do-not-remove

Resampling-based inference in Python based on data resampling and permutation.

This package was created by Daniel Saxton and is now maintained by Hans Dembinski.

Features
--------

- Bootstrap resampling: ordinary or balanced with optional stratification
- Extended bootstrap resampling: also varies sample size
- Parametric resampling: Gaussian, Poisson, gamma, etc.)
- Jackknife estimates of bias and variance of any estimator
- Compute bootstrap confidence intervals (percentile or BCa) for any estimator
- Permutation-based variants of traditional statistical tests (**USP test of independence** and others)
- Tools for working with empirical distributions (CDF, quantile, etc.)
- Depends only on `numpy`_ and `scipy`_

Example
-------

We bootstrap the uncertainty of the arithmetic mean, an estimator for the expectation. In this case, we know the formula to compute this uncertainty and can compare it to the bootstrap result. More complex examples can be found `in the documentation <https://resample.readthedocs.io/en/stable/tutorials.html>`_.

.. code-block:: python

      from resample.bootstrap import variance
      import numpy as np

      # data
      d = [1, 2, 6, 3, 5]

      # this call is all you need
      stdev_of_mean = variance(np.mean, d) ** 0.5
      
      print(f"bootstrap {stdev_of_mean:.2f}")
      print(f"exact {np.std(d) / len(d) ** 0.5:.2f}")
      # bootstrap 0.82
      # exact 0.83

The amazing thing is that the bootstrap works as well for arbitrarily complex estimators.
The bootstrap often provides good results even when the sample size is small.

.. _numpy: http://www.numpy.org
.. _scipy: https://www.scipy.org

Installation
------------
You can install with pip.

.. code-block:: shell

      pip install resample

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "resample",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Daniel Saxton <dsaxton@pm.me>, Hans Dembinski <hans.dembinski@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/90/0c/0c748a327803ae1cfd556b28eff119fc9763b17de8a2c6b8b858f99eef30/resample-1.10.0.tar.gz",
    "platform": null,
    "description": ".. |resample| image:: doc/_static/logo.svg\n   :alt: resample\n   :target: http://resample.readthedocs.io\n\n|resample|\n==========\n\n.. image:: https://img.shields.io/pypi/v/resample.svg\n   :target: https://pypi.org/project/resample\n.. image:: https://img.shields.io/conda/vn/conda-forge/resample.svg\n   :target: https://github.com/conda-forge/resample-feedstock\n.. image:: https://github.com/resample-project/resample/actions/workflows/test.yml/badge.svg\n   :target: https://github.com/resample-project/resample/actions/workflows/tests.yml\n.. image:: https://coveralls.io/repos/github/resample-project/resample/badge.svg\n   :target: https://coveralls.io/github/resample-project/resample\n.. image:: https://readthedocs.org/projects/resample/badge/?version=stable\n   :target: https://resample.readthedocs.io/en/stable\n.. image:: https://img.shields.io/pypi/l/resample\n   :target: https://pypi.org/project/resample\n.. image:: https://zenodo.org/badge/145776396.svg\n   :target: https://zenodo.org/badge/latestdoi/145776396\n\n`Link to full documentation`_\n\n.. _Link to full documentation: http://resample.readthedocs.io\n\n.. skip-marker-do-not-remove\n\nResampling-based inference in Python based on data resampling and permutation.\n\nThis package was created by Daniel Saxton and is now maintained by Hans Dembinski.\n\nFeatures\n--------\n\n- Bootstrap resampling: ordinary or balanced with optional stratification\n- Extended bootstrap resampling: also varies sample size\n- Parametric resampling: Gaussian, Poisson, gamma, etc.)\n- Jackknife estimates of bias and variance of any estimator\n- Compute bootstrap confidence intervals (percentile or BCa) for any estimator\n- Permutation-based variants of traditional statistical tests (**USP test of independence** and others)\n- Tools for working with empirical distributions (CDF, quantile, etc.)\n- Depends only on `numpy`_ and `scipy`_\n\nExample\n-------\n\nWe bootstrap the uncertainty of the arithmetic mean, an estimator for the expectation. In this case, we know the formula to compute this uncertainty and can compare it to the bootstrap result. More complex examples can be found `in the documentation <https://resample.readthedocs.io/en/stable/tutorials.html>`_.\n\n.. code-block:: python\n\n      from resample.bootstrap import variance\n      import numpy as np\n\n      # data\n      d = [1, 2, 6, 3, 5]\n\n      # this call is all you need\n      stdev_of_mean = variance(np.mean, d) ** 0.5\n      \n      print(f\"bootstrap {stdev_of_mean:.2f}\")\n      print(f\"exact {np.std(d) / len(d) ** 0.5:.2f}\")\n      # bootstrap 0.82\n      # exact 0.83\n\nThe amazing thing is that the bootstrap works as well for arbitrarily complex estimators.\nThe bootstrap often provides good results even when the sample size is small.\n\n.. _numpy: http://www.numpy.org\n.. _scipy: https://www.scipy.org\n\nInstallation\n------------\nYou can install with pip.\n\n.. code-block:: shell\n\n      pip install resample\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Resampling-based inference in Python",
    "version": "1.10.0",
    "project_urls": {
        "documentation": "https://resample.readthedocs.io/en/stable/",
        "repository": "http://github.com/resample-project/resample"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c70fff56405c580c84aeb510c965c84dcaa0d2e6852802baac22dcf67a72cb05",
                "md5": "41e2a18eee817f393d444235dd4f2be5",
                "sha256": "b85449c2feb3442e608783c815b0717f84b0e845d080a4dc150f64df93d2ed7e"
            },
            "downloads": -1,
            "filename": "resample-1.10.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "41e2a18eee817f393d444235dd4f2be5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 20270,
            "upload_time": "2024-06-21T17:15:25",
            "upload_time_iso_8601": "2024-06-21T17:15:25.983024Z",
            "url": "https://files.pythonhosted.org/packages/c7/0f/ff56405c580c84aeb510c965c84dcaa0d2e6852802baac22dcf67a72cb05/resample-1.10.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "900c0c748a327803ae1cfd556b28eff119fc9763b17de8a2c6b8b858f99eef30",
                "md5": "be37a8ae9486a374f311fcc9d5d54216",
                "sha256": "4bb4780340b83cc9097b2ba2f5d5b81a52dd1bbd40689ad80dd0437addb40b22"
            },
            "downloads": -1,
            "filename": "resample-1.10.0.tar.gz",
            "has_sig": false,
            "md5_digest": "be37a8ae9486a374f311fcc9d5d54216",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 632062,
            "upload_time": "2024-06-21T17:16:08",
            "upload_time_iso_8601": "2024-06-21T17:16:08.453458Z",
            "url": "https://files.pythonhosted.org/packages/90/0c/0c748a327803ae1cfd556b28eff119fc9763b17de8a2c6b8b858f99eef30/resample-1.10.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-21 17:16:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "resample-project",
    "github_project": "resample",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "resample"
}
        
Elapsed time: 0.75403s