samppy


Namesamppy JSON
Version 1.3.0 PyPI version JSON
download
home_page
SummaryHamiltonian sampling and analysis of sampled distributions
upload_time2023-04-17 00:38:20
maintainer
docs_urlNone
authorArne Leijon
requires_python>=3.9
licenseMIT License
keywords sampling hamiltonian mcmc bayesian credibility entropy
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Package **samppy** implements Hamiltonian Markov-chain sampling and
some additional analysis methods for multivariate probability distributions.

The probability distribution is represented only by
an array of independent and identically distributed (i.i.d.) samples
drawn from the distribution.

The package includes four modules:

* Module **hamiltonian_sampler** implements Hamiltonian Markov-Chain sampling.
    A *HamiltonianSampler* instance can generate
    random samples of a multivariate probability distribution,
    defined only by an non-normalized *log-likelihood* function,
    and the *gradient* of that function.

    The generated batch of sample vectors is stored in a 2D numpy array,
    either as rows or as columns.

    Class `HamiltonianSampler` defines a standard isotropic sampler.
    Class `HamiltonianBoundedSampler` is a subclass also allowing
    one- or two-sided interval limits for all vector elements.

* Module **credibility** includes functions to estimate *jointly credible differences*
    and/or *correlations* between pairs of elements
    in a random vector with a multivariate probability distribution,
    represented only by samples. 
    
* A separate module **credibility_pd** has the same functionality, 
    but operates on input data in Pandas DataFrame or Series format.

* Module **sample_entropy** includes a function to estimate the *differential entropy*
    of a multivariate probability distribution, represented only by samples.
    The entropy is estimated by the Kozachenko-Leonenko nearest-neighbor approximation
    (Singh and Poczos, 2016).

## Usage

This package was developed mainly for use by another project.
It is distributed separately because it may be useful for other purposes.

The Hamiltonian sampler code was inspired by the LAHMC project by
Jasha Sohlstein. The present implementation includes
some safety features to facilitate its use.
The present sampler does *not* include sampling within a general subspace manifold,
but it allows bounded ranges for vector elements.

## Requirements

The package requires recent versions of Numpy and Scipy. 
These are automatically installed.
Pandas is not installed automatically, 
because the module requiring Pandas input 
will only be called from a program that already uses Pandas.

## References

R M Neal (2011): MCMC using Hamiltonian dynamics. Ch. 5 in
Brooks et al. (eds) *Handbook of Markov Chain Monte Carlo*.
Chapman and Hall / CRC Press.

A. Leijon, G. E. Henter, and M. Dahlquist (2016):
Bayesian analysis of phoneme confusion matrices.
*IEEE Transactions on Audio, Speech, and Language Processing* 24(3):469–482.
(Describes an application of credible-difference calculation.)

A. Leijon, P. von Gablenz, I. Holube, J. Taghia, and K. Smeds (2023).
Bayesian analysis of ecological momentary assessment (EMA) data
collected in adults before and after hearing rehabilitation. 
*Frontiers in Digital Health*, 5(1100705).
[download](https://www.frontiersin.org/articles/10.3389/fdgth.2023.1100705/full)

F Perez-Cruz (2008): Estimation of Information Theoretic Measures
for Continuous Random Variables.
*Advances in Neural Information Processing Systems 21 (NIPS 2008)*.

S Singh and B Poczos (2016): Analysis of k-nearest neighbor distances
with application to entropy estimation.
*arXiv:1603.08578 [math.ST]*.


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "samppy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "sampling,Hamiltonian,MCMC,Bayesian,credibility,entropy",
    "author": "Arne Leijon",
    "author_email": "leijon@kth.se",
    "download_url": "https://files.pythonhosted.org/packages/51/0b/faf7ac6a53081880fd8727c838460c987793e8a594ae8ff6f86070e9935c/samppy-1.3.0.tar.gz",
    "platform": null,
    "description": "Package **samppy** implements Hamiltonian Markov-chain sampling and\nsome additional analysis methods for multivariate probability distributions.\n\nThe probability distribution is represented only by\nan array of independent and identically distributed (i.i.d.) samples\ndrawn from the distribution.\n\nThe package includes four modules:\n\n* Module **hamiltonian_sampler** implements Hamiltonian Markov-Chain sampling.\n    A *HamiltonianSampler* instance can generate\n    random samples of a multivariate probability distribution,\n    defined only by an non-normalized *log-likelihood* function,\n    and the *gradient* of that function.\n\n    The generated batch of sample vectors is stored in a 2D numpy array,\n    either as rows or as columns.\n\n    Class `HamiltonianSampler` defines a standard isotropic sampler.\n    Class `HamiltonianBoundedSampler` is a subclass also allowing\n    one- or two-sided interval limits for all vector elements.\n\n* Module **credibility** includes functions to estimate *jointly credible differences*\n    and/or *correlations* between pairs of elements\n    in a random vector with a multivariate probability distribution,\n    represented only by samples. \n    \n* A separate module **credibility_pd** has the same functionality, \n    but operates on input data in Pandas DataFrame or Series format.\n\n* Module **sample_entropy** includes a function to estimate the *differential entropy*\n    of a multivariate probability distribution, represented only by samples.\n    The entropy is estimated by the Kozachenko-Leonenko nearest-neighbor approximation\n    (Singh and Poczos, 2016).\n\n## Usage\n\nThis package was developed mainly for use by another project.\nIt is distributed separately because it may be useful for other purposes.\n\nThe Hamiltonian sampler code was inspired by the LAHMC project by\nJasha Sohlstein. The present implementation includes\nsome safety features to facilitate its use.\nThe present sampler does *not* include sampling within a general subspace manifold,\nbut it allows bounded ranges for vector elements.\n\n## Requirements\n\nThe package requires recent versions of Numpy and Scipy. \nThese are automatically installed.\nPandas is not installed automatically, \nbecause the module requiring Pandas input \nwill only be called from a program that already uses Pandas.\n\n## References\n\nR M Neal (2011): MCMC using Hamiltonian dynamics. Ch. 5 in\nBrooks et al. (eds) *Handbook of Markov Chain Monte Carlo*.\nChapman and Hall / CRC Press.\n\nA. Leijon, G. E. Henter, and M. Dahlquist (2016):\nBayesian analysis of phoneme confusion matrices.\n*IEEE Transactions on Audio, Speech, and Language Processing* 24(3):469\u2013482.\n(Describes an application of credible-difference calculation.)\n\nA. Leijon, P. von Gablenz, I. Holube, J. Taghia, and K. Smeds (2023).\nBayesian analysis of ecological momentary assessment (EMA) data\ncollected in adults before and after hearing rehabilitation. \n*Frontiers in Digital Health*, 5(1100705).\n[download](https://www.frontiersin.org/articles/10.3389/fdgth.2023.1100705/full)\n\nF Perez-Cruz (2008): Estimation of Information Theoretic Measures\nfor Continuous Random Variables.\n*Advances in Neural Information Processing Systems 21 (NIPS 2008)*.\n\nS Singh and B Poczos (2016): Analysis of k-nearest neighbor distances\nwith application to entropy estimation.\n*arXiv:1603.08578 [math.ST]*.\n\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Hamiltonian sampling and analysis of sampled distributions",
    "version": "1.3.0",
    "split_keywords": [
        "sampling",
        "hamiltonian",
        "mcmc",
        "bayesian",
        "credibility",
        "entropy"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d7c4c8ca65584d44b9b85de071858e9d6baff6840d2aae0a0c9b0461da33a4fa",
                "md5": "f5d087395f53834ca8690306fb65c054",
                "sha256": "ea1b305263a2817b4080445bb93155ae129f0096b3de33be12038a0b0df226ec"
            },
            "downloads": -1,
            "filename": "samppy-1.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f5d087395f53834ca8690306fb65c054",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 26931,
            "upload_time": "2023-04-17T00:38:18",
            "upload_time_iso_8601": "2023-04-17T00:38:18.513317Z",
            "url": "https://files.pythonhosted.org/packages/d7/c4/c8ca65584d44b9b85de071858e9d6baff6840d2aae0a0c9b0461da33a4fa/samppy-1.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "510bfaf7ac6a53081880fd8727c838460c987793e8a594ae8ff6f86070e9935c",
                "md5": "08b92a606af7b8a9a7639435f9c76e92",
                "sha256": "f852d0c84c7166a928821b066b8a16dfdc5e6ad6e56618be5228a3ec38ef8ef3"
            },
            "downloads": -1,
            "filename": "samppy-1.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "08b92a606af7b8a9a7639435f9c76e92",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 24532,
            "upload_time": "2023-04-17T00:38:20",
            "upload_time_iso_8601": "2023-04-17T00:38:20.778947Z",
            "url": "https://files.pythonhosted.org/packages/51/0b/faf7ac6a53081880fd8727c838460c987793e8a594ae8ff6f86070e9935c/samppy-1.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-17 00:38:20",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "samppy"
}
        
Elapsed time: 0.06252s