{
"info": {
"author": "Arno Onken",
"author_email": "asnelt@asnelt.org",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Scientific/Engineering"
],
"description": "=============================\nmixedvines Package for Python\n=============================\n\nPackage for canonical vine copula trees with mixed continuous and discrete\nmarginals. If you use this software for publication, please cite [ONKEN2016]_.\n\n\nDescription\n-----------\n\nThis package contains a complete framework based on canonical vine copulas for\nmodelling multivariate data that are partly discrete and partly continuous. The\nresulting multivariate distributions are flexible with rich dependence\nstructures and marginals.\n\nFor continuous marginals, implementations of the normal and the gamma\ndistributions are provided. For discrete marginals, Poisson, binomial and\nnegative binomial distributions are provided. As bivariate copula building\nblocks, the Gaussian, Frank and Clayton families as well as rotation transformed\nfamilies are provided. Additional marginal and pair copula distributions can be\nadded easily.\n\nThe package includes methods for sampling, likelihood calculation and inference,\nall of which have quadratic complexity. These procedures are combined to\nestimate entropy by means of Monte Carlo integration.\n\nPlease see [ONKEN2016]_ for a more detailed description of the framework.\n\n\nDocumentation\n-------------\n\nThe full documentation for the mixedvines package is available at\n`Read the Docs\n`_.\n\n\nRequirements\n------------\n\nThe package is compatible with Python 2.7 and 3.x and additionaly requires\n`NumPy and SciPy\n`_.\n\n\nInstallation\n------------\n\nTo install the mixedvines package, run::\n\n pip install mixedvines\n\n\nUsage\n-----\n\nSuppose that data are given in a NumPy array ``samples`` with shape ``(n, d)``,\nwhere ``n`` is the number of samples and ``d`` is the number of elements per\nsample. First, specify which of the elements are continuous. If, for instance,\nthe distribution has three elements and the first and last element are\ncontinuous whereas the second element is discrete:\n\n.. code-block:: python\n\n is_continuous = [True, False, True]\n\nTo fit a mixed vine to the samples:\n\n.. code-block:: python\n\n from mixedvines.mixedvine import MixedVine\n vine = MixedVine.fit(samples, is_continuous)\n\n``vine`` is now a ``MixedVine`` object. To draw samples from the distribution,\ncalculate their density and estimate the distribution entropy in units of bits:\n\n.. code-block:: python\n\n samples = vine.rvs(size=100)\n logpdf = vine.logpdf(samples)\n (entropy, standard_error_mean) = vine.entropy(sem_tol=1e-2)\n\nTo manually construct and visualize a simple mixed vine model:\n\n.. code-block:: python\n\n from scipy.stats import norm, gamma, poisson\n import numpy as np\n from mixedvines.copula import GaussianCopula, ClaytonCopula, FrankCopula\n from mixedvines.mixedvine import MixedVine\n import matplotlib.pyplot as plt\n import itertools\n # Manually construct mixed vine\n dim = 3 # Dimension\n vine = MixedVine(dim)\n # Specify marginals\n vine.set_marginal(0, norm(0, 1))\n vine.set_marginal(1, poisson(5))\n vine.set_marginal(2, gamma(2, 0, 4))\n # Specify pair copulas\n vine.set_copula(1, 0, GaussianCopula(0.5))\n vine.set_copula(1, 1, FrankCopula(4))\n vine.set_copula(2, 0, ClaytonCopula(5))\n # Calculate probability density function on lattice\n bnds = np.empty((3), dtype=object)\n bnds[0] = [-3, 3]\n bnds[1] = [0, 15]\n bnds[2] = [0.5, 25]\n (x0, x1, x2) = np.mgrid[bnds[0][0]:bnds[0][1]:0.05, bnds[1][0]:bnds[1][1],\n bnds[2][0]:bnds[2][1]:0.1]\n points = np.array([x0.ravel(), x1.ravel(), x2.ravel()]).T\n pdf = vine.pdf(points)\n pdf = np.reshape(pdf, x1.shape)\n # Generate random variates\n size = 100\n samples = vine.rvs(size)\n # Visualize 2d marginals and samples\n comb = list(itertools.combinations(range(dim), 2))\n for i, cmb in enumerate(comb):\n # Sum over all axes not in cmb\n cmb_inv = tuple(set(range(dim)) - set(cmb))\n margin = np.sum(pdf, axis=cmb_inv).T\n plt.subplot(2, len(comb), i + 1)\n plt.imshow(margin, aspect='auto', interpolation='none', cmap='hot',\n origin='lower', extent=[bnds[cmb[0]][0], bnds[cmb[0]][1],\n bnds[cmb[1]][0], bnds[cmb[1]][1]])\n plt.ylabel('$x_' + str(cmb[1]) + '$')\n plt.subplot(2, len(comb), len(comb) + i + 1)\n plt.scatter(samples[:, cmb[0]], samples[:, cmb[1]], s=1)\n plt.xlim(bnds[cmb[0]][0], bnds[cmb[0]][1])\n plt.ylim(bnds[cmb[1]][0], bnds[cmb[1]][1])\n plt.xlabel('$x_' + str(cmb[0]) + '$')\n plt.ylabel('$x_' + str(cmb[1]) + '$')\n plt.tight_layout()\n plt.show()\n\nThis code shows the 2d marginals and 100 samples of a 3d mixed vine.\n\n\nSource code\n-----------\n\nThe source code of the mixedvines package is hosted on\n`GitHub\n`_.\n\n\nReferences\n----------\n\n.. [ONKEN2016] A. Onken and S. Panzeri (2016). Mixed vine copulas as joint\n models of spike counts and local field potentials. In D. D. Lee,\n M. Sugiyama, U. V. Luxburg, I. Guyon and R. Garnett, editors, Advances in\n Neural Information Processing Systems 29 (NIPS 2016), pages 1325-1333.\n\n\nLicense\n-------\n\nCopyright (C) 2017, 2018 Arno Onken\n\nThis file is part of the mixedvines package.\n\nThe mixedvines package is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by the Free\nSoftware Foundation; either version 3 of the License, or (at your option) any\nlater version.\n\nThe mixedvines package is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\nFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more\ndetails.\n\nYou should have received a copy of the GNU General Public License along with\nthis program; if not, see .\n\n\n",
"description_content_type": "",
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/asnelt/mixedvines/",
"keywords": "copula mixed vine continuous dicrete entropy",
"license": "GPLv3+",
"maintainer": "",
"maintainer_email": "",
"name": "mixedvines",
"package_url": "https://pypi.org/project/mixedvines/",
"platform": "",
"project_url": "https://pypi.org/project/mixedvines/",
"project_urls": {
"Homepage": "https://github.com/asnelt/mixedvines/"
},
"release_url": "https://pypi.org/project/mixedvines/1.2.0/",
"requires_dist": [
"numpy",
"scipy"
],
"requires_python": "",
"summary": "Package for canonical vine copula trees with mixed continuous and discrete marginals.",
"version": "1.2.0"
},
"last_serial": 4581854,
"releases": {
"1.0": [
{
"comment_text": "",
"digests": {
"md5": "db43e4ab6ff9a41c4a7806b89f231234",
"sha256": "3c43c7bf706ea9219b909ca5bf3cd8fd42730a737db7dda0a0ad064024763392"
},
"downloads": -1,
"filename": "mixedvines-1.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "db43e4ab6ff9a41c4a7806b89f231234",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 20576,
"upload_time": "2017-05-24T10:02:59",
"url": "https://files.pythonhosted.org/packages/2b/af/705f2006f9fb4af835ee5a296a4531688d2fdd5867f3bbf5f5ff7bd2e5cd/mixedvines-1.0-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "8aed30d281236e4ed411ddec8592882b",
"sha256": "ae07031768a34492c098e436135cb6d8258b68ae9b0669f9f12ab777a7c32bae"
},
"downloads": -1,
"filename": "mixedvines-1.0.tar.gz",
"has_sig": false,
"md5_digest": "8aed30d281236e4ed411ddec8592882b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 29471,
"upload_time": "2017-05-24T10:03:01",
"url": "https://files.pythonhosted.org/packages/36/33/41410a55b6264383f2f57ffc3478f37d38d5881b517a03155719c839f36c/mixedvines-1.0.tar.gz"
}
],
"1.1": [
{
"comment_text": "",
"digests": {
"md5": "a174cb239b6fe3e7914b3b948ec86703",
"sha256": "f5ae4b3ac59fbd0bb41c5c743ae16a63d2de106514602de1c7cb6e7773044ea9"
},
"downloads": -1,
"filename": "mixedvines-1.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "a174cb239b6fe3e7914b3b948ec86703",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 20607,
"upload_time": "2017-06-09T14:07:09",
"url": "https://files.pythonhosted.org/packages/34/8c/f36ef85c5808476867edfcef103ba2acfe01ec4203ff74adaa52b9871d56/mixedvines-1.1-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "cc52e69d26404fb1198721e1facb119f",
"sha256": "d538f6461698aa75259072533d50c99cf5bd0071bde73e828a2c7babdf40ead1"
},
"downloads": -1,
"filename": "mixedvines-1.1.tar.gz",
"has_sig": false,
"md5_digest": "cc52e69d26404fb1198721e1facb119f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 29397,
"upload_time": "2017-06-09T14:07:11",
"url": "https://files.pythonhosted.org/packages/00/65/19b339bdd23e34d806d8280efee0ae0ed4db49e5bb28ea6579c14ed9853f/mixedvines-1.1.tar.gz"
}
],
"1.2.0": [
{
"comment_text": "",
"digests": {
"md5": "2827a18c270fcabe32508061d1eae41e",
"sha256": "d1b33daaa6414186f7cc066685ac676019a8c3edfd65f9757f32147b6daf77b8"
},
"downloads": -1,
"filename": "mixedvines-1.2.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "2827a18c270fcabe32508061d1eae41e",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 29554,
"upload_time": "2018-12-10T17:49:56",
"url": "https://files.pythonhosted.org/packages/52/9a/ea652d41dfd445b4dec3c01fb26a9c9f8566539ecfc72292841308ee10c2/mixedvines-1.2.0-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "0e406de1005151c6f3a2b80bc0f6fc83",
"sha256": "ac6a6153d90cffda98c6739be913c997998fbd49809db87773b13d52a651c8f1"
},
"downloads": -1,
"filename": "mixedvines-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "0e406de1005151c6f3a2b80bc0f6fc83",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 28602,
"upload_time": "2018-12-10T17:49:58",
"url": "https://files.pythonhosted.org/packages/13/65/cf72a7433f882ae8a26630c512b0cdc33cdd51f42fe530547b00a40a19f7/mixedvines-1.2.0.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "2827a18c270fcabe32508061d1eae41e",
"sha256": "d1b33daaa6414186f7cc066685ac676019a8c3edfd65f9757f32147b6daf77b8"
},
"downloads": -1,
"filename": "mixedvines-1.2.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "2827a18c270fcabe32508061d1eae41e",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 29554,
"upload_time": "2018-12-10T17:49:56",
"url": "https://files.pythonhosted.org/packages/52/9a/ea652d41dfd445b4dec3c01fb26a9c9f8566539ecfc72292841308ee10c2/mixedvines-1.2.0-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "0e406de1005151c6f3a2b80bc0f6fc83",
"sha256": "ac6a6153d90cffda98c6739be913c997998fbd49809db87773b13d52a651c8f1"
},
"downloads": -1,
"filename": "mixedvines-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "0e406de1005151c6f3a2b80bc0f6fc83",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 28602,
"upload_time": "2018-12-10T17:49:58",
"url": "https://files.pythonhosted.org/packages/13/65/cf72a7433f882ae8a26630c512b0cdc33cdd51f42fe530547b00a40a19f7/mixedvines-1.2.0.tar.gz"
}
]
}