{ "info": { "author": "Travis A. O'Brien", "author_email": "TAOBrien@lbl.gov", "bugtrack_url": null, "classifiers": [], "description": "fastKDE\n=======\n\nSoftware Overview\n-----------------\n\nfastKDE calculates a kernel density estimate of arbitrarily dimensioned\ndata; it does so rapidly and robustly using recently developed KDE\ntechniques. It does so with statistical skill that is as good as\nstate-of-the-science 'R' KDE packages, and it does so 10,000 times\nfaster for bivariate data (even better improvements for higher\ndimensionality).\n\n*Please cite the following papers when using this method:*\n\n `O\u2019Brien, T. A., Kashinath, K., Cavanaugh, N. R., Collins, W. D. & O\u2019Brien, J. P. A fast and objective multidimensional kernel density estimation method: fastKDE. Comput. Stat. Data Anal. 101, 148\u2013160 (2016). `__\n\n `O\u2019Brien, T. A., Collins, W. D., Rauscher, S. A. & Ringler, T. D. Reducing the computational cost of the ECF using a nuFFT: A fast and objective probability density estimation method. Comput. Stat. Data Anal. 79, 222\u2013234 (2014). `__\n\nExample usage:\n\nFor a standard PDF\n~~~~~~~~~~~~~~~~~~\n\n::\n\n #!python\n \n import numpy as np\n from fastkde import fastKDE\n import pylab as PP\n\n #Generate two random variables dataset (representing 100000 pairs of datapoints)\n N = 2e5\n var1 = 50*np.random.normal(size=N) + 0.1\n var2 = 0.01*np.random.normal(size=N) - 300\n \n #Do the self-consistent density estimate\n myPDF,axes = fastKDE.pdf(var1,var2)\n\n #Extract the axes from the axis list\n v1,v2 = axes\n\n #Plot contours of the PDF should be a set of concentric ellipsoids centered on\n #(0.1, -300) Comparitively, the y axis range should be tiny and the x axis range\n #should be large\n PP.contour(v1,v2,myPDF)\n PP.show()\n\n\n\nFor a conditional PDF\n~~~~~~~~~~~~~~~~~~~~~\n\nThe following code generates samples from a non-trivial joint\ndistribution\n\n.. code:: python\n\n\tfrom fastkde import fastKDE\n\timport pylab as PP\n\timport numpy as np\n\n\t#***************************\n\t# Generate random samples\n\t#***************************\n\t# Stochastically sample from the function underlyingFunction() (a sigmoid):\n\t# sample the absicissa values from a gamma distribution\n\t# relate the ordinate values to the sample absicissa values and add\n\t# noise from a normal distribution\n\n\t#Set the number of samples\n\tnumSamples = int(1e6)\n\n\t#Define a sigmoid function\n\tdef underlyingFunction(x,x0=305,y0=200,yrange=4):\n\t return (yrange/2)*np.tanh(x-x0) + y0\n\n\txp1,xp2,xmid = 5,2,305 #Set gamma distribution parameters\n\typ1,yp2 = 0,12 #Set normal distribution parameters (mean and std)\n\n\t#Generate random samples of X from the gamma distribution\n\tx = -(np.random.gamma(xp1,xp2,int(numSamples))-xp1*xp2) + xmid\n\t#Generate random samples of y from x and add normally distributed noise\n\ty = underlyingFunction(x) + np.random.normal(loc=yp1,scale=yp2,size=numSamples)\n\n**Now that we have the x,y samples, the following code calcuates the\nconditional**\n\n.. code:: python\n\n #***************************\n # Calculate the conditional\n #***************************\n pOfYGivenX,axes = fastKDE.conditional(y,x)\n\nThe following plot shows the results:\n\n.. code:: python\n\n #***************************\n # Plot the conditional\n #***************************\n fig,axs = PP.subplots(1,2,figsize=(10,5))\n\n #Plot a scatter plot of the incoming data\n axs[0].plot(x,y,'k.',alpha=0.1)\n axs[0].set_title('Original (x,y) data')\n\n #Set axis labels\n for i in (0,1):\n axs[i].set_xlabel('x')\n axs[i].set_ylabel('y')\n\n #Draw a contour plot of the conditional\n axs[1].contourf(axes[0],axes[1],pOfYGivenX,64)\n #Overplot the original underlying relationship\n axs[1].plot(axes[0],underlyingFunction(axes[0]),linewidth=3,linestyle='--',alpha=0.5)\n axs[1].set_title('P(y|x)')\n\n #Set axis limits to be the same\n xlim = [np.amin(axes[0]),np.amax(axes[0])]\n ylim = [np.amin(axes[1]),np.amax(axes[1])]\n axs[1].set_xlim(xlim)\n axs[1].set_ylim(ylim)\n axs[0].set_xlim(xlim)\n axs[0].set_ylim(ylim)\n\n fig.tight_layout()\n\n PP.savefig('conditional_demo.png')\n PP.show()\n\n.. figure:: conditional_demo.png\n :alt: Conditional PDF\n\n Conditional PDF\n\nHow do I get set up?\n--------------------\n\nA standard python build: ``python setup.py install``\n\nor\n\n``pip install fastkde``\n\nDownload the source\n~~~~~~~~~~~~~~~~~~~\n\nPlease contact Travis A. O'Brien TAOBrien@lbl.gov to obtain the latest\nversion of the source.\n\nInstall pre-requisites\n~~~~~~~~~~~~~~~~~~~~~~\n\nThis code requires the following software:\n\n- Python >= 2.7.3\n- Numpy >= 1.7\n- scipy\n- cython\n\nCopyright Information\n---------------------\n\n::\n\n LAWRENCE BERKELEY NATIONAL LABORATORY\n RESEARCH & DEVELOPMENT, NON-COMMERCIAL USE ONLY, LICENSE\n \n Copyright (c) 2015, The Regents of the University of California, through\n Lawrence Berkeley National Laboratory (subject to receipt of any required\n approvals from the U.S. Dept. of Energy). All rights reserved.\n \n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n \n (1) Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n \n (2) Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n \n (3) Neither the name of the University of California, Lawrence Berkeley\n National Laboratory, U.S. Dept. of Energy nor the names of its contributors\n may be used to endorse or promote products derived from this software\n without specific prior written permission.\n \n (4) Use of the software, in source or binary form is FOR RESEARCH\n & DEVELOPMENT, NON-COMMERCIAL USE, PURPOSES ONLY. All commercial use rights\n for the software are hereby reserved. A separate commercial use license is\n available from Lawrence Berkeley National Laboratory.\n\n (5) In the event you create any bug fixes, patches, upgrades, updates,\n modifications, derivative works or enhancements to the source code or\n binary code of the software (\"Enhancements\") you hereby grant The Regents of\n the University of California and the U.S. Government a paid-up,\n non-exclusive, irrevocable, worldwide license in the Enhancements to\n reproduce, prepare derivative works, distribute copies to the public,\n perform publicly and display publicly, and to permit others to do so. THIS\n SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n POSSIBILITY OF SUCH DAMAGE. *** Copyright Notice *** FastKDE v1.0,\n Copyright (c) 2015, The Regents of the University of California, through\n Lawrence Berkeley National Laboratory (subject to receipt of any required\n approvals from the U.S. Dept. of Energy). All rights reserved.\n If you have questions about your rights to use or distribute this software,\n please contact Berkeley Lab's Innovation & Partnerships Office at\n IPO@lbl.gov.\n NOTICE. This software was developed under funding from the U.S. Department of Energy. As such,\n the U.S. Government has been granted for itself and others acting on its\n behalf a paid-up, nonexclusive, irrevocable, worldwide license in the\n Software to reproduce, prepare derivative works, and perform publicly and\n display publicly. Beginning five (5) years after the date permission to\n assert copyright is obtained from the U.S. Department of Energy, and\n subject to any subsequent five (5) year renewals, the U.S. Government is\n granted for itself and others acting on its behalf a paid-up, nonexclusive,\n irrevocable, worldwide license in the Software to reproduce, prepare\n derivative works, distribute copies to the public, perform publicly and\n display publicly, and to permit others to do so.\n ****************************\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "https://bitbucket.org/lbl-cascade/fastkde/get/v1.0.13.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/lbl-cascade/fastkde", "keywords": "statistics", "license": "", "maintainer": "", "maintainer_email": "", "name": "fastkde", "package_url": "https://pypi.org/project/fastkde/", "platform": "", "project_url": "https://pypi.org/project/fastkde/", "project_urls": { "Download": "https://bitbucket.org/lbl-cascade/fastkde/get/v1.0.13.tar.gz", "Homepage": "https://bitbucket.org/lbl-cascade/fastkde" }, "release_url": "https://pypi.org/project/fastkde/1.0.13/", "requires_dist": null, "requires_python": "", "summary": "Tools for fast and robust univariate and multivariate kernel density estimation", "version": "1.0.13" }, "last_serial": 3037623, "releases": { "1.0.10": [ { "comment_text": "", "digests": { "md5": "a17e90fa1af0ff5eb6e56255d6840ab5", "sha256": "aa77e0c04aac2b8bf18e7570a97f57c635b3c4695db14ccf655bf6ef57654b68" }, "downloads": -1, "filename": "fastkde-1.0.10.tar.gz", "has_sig": false, "md5_digest": "a17e90fa1af0ff5eb6e56255d6840ab5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 95379, "upload_time": "2016-09-22T20:30:19", "url": "https://files.pythonhosted.org/packages/90/5a/34b4560d9a5345b04a6cd9ba47aabd93e177bc79b818877a856398e73e7a/fastkde-1.0.10.tar.gz" } ], "1.0.11": [ { "comment_text": "", "digests": { "md5": "20808cf9897bb916b8e66dbbfad93094", "sha256": "0b5321461a0d0451646a622a851d8d8c9f9fa3560f6efffbd42e7aeed1f51e4d" }, "downloads": -1, "filename": "fastkde-1.0.11.tar.gz", "has_sig": false, "md5_digest": "20808cf9897bb916b8e66dbbfad93094", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 95186, "upload_time": "2017-05-15T17:19:37", "url": "https://files.pythonhosted.org/packages/97/c0/8a012acb504337bc797438c8ed021f46dee92cd2897fcfbaf62b94cdb96d/fastkde-1.0.11.tar.gz" } ], "1.0.12": [ { "comment_text": "", "digests": { "md5": "e2c2a466bf3cb6d3f301b715420b13d9", "sha256": "d8f8ec0c44663601e6e6a3e39105c4496d1c0eb3c4fa4ee8bb78962ee29946f2" }, "downloads": -1, "filename": "fastkde-1.0.12.tar.gz", "has_sig": false, "md5_digest": "e2c2a466bf3cb6d3f301b715420b13d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 95196, "upload_time": "2017-05-16T19:51:01", "url": "https://files.pythonhosted.org/packages/66/f8/4dd802ad80e3b3ed1fa19031fdb03d255d0a21c1cfdda6e79c96bac695d2/fastkde-1.0.12.tar.gz" } ], "1.0.13": [ { "comment_text": "", "digests": { "md5": "0d0c3922ecc3477180a6a3c60ccff555", "sha256": "8898d0db48947fd6431cab01175745c24243f6bd7d18741e5cea2138b4ab5fb0" }, "downloads": -1, "filename": "fastkde-1.0.13.tar.gz", "has_sig": false, "md5_digest": "0d0c3922ecc3477180a6a3c60ccff555", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 96862, "upload_time": "2017-07-20T19:05:02", "url": "https://files.pythonhosted.org/packages/1c/e5/7028b17c7efe2507b7e6ee03e3e2c35fdee2db4fab7b86d402757d6a5508/fastkde-1.0.13.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "f2098f84d65aaaa6945d385f388b7265", "sha256": "133f79ff792c4d8d6e13ebf7247c71df7c84798ba595bd23c588ac228e7e38c9" }, "downloads": -1, "filename": "fastkde-1.0.7.tar.gz", "has_sig": false, "md5_digest": "f2098f84d65aaaa6945d385f388b7265", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 95146, "upload_time": "2016-04-19T16:36:02", "url": "https://files.pythonhosted.org/packages/f9/52/26fc5784def0af0e13bc7b58e031dea8709019ff0f98df0796f3b78cb605/fastkde-1.0.7.tar.gz" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "eb4f5fea2568f204c819fb45d1709ced", "sha256": "742d65721abacf10f59748f1ad883ce848e15d87cd57cdaacc0b2122b9c76d45" }, "downloads": -1, "filename": "fastkde-1.0.8.tar.gz", "has_sig": false, "md5_digest": "eb4f5fea2568f204c819fb45d1709ced", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 95221, "upload_time": "2016-04-19T23:29:31", "url": "https://files.pythonhosted.org/packages/00/5d/6388f6e8628ecfe2a314de4126d051eeba9c6086b1683e28a1720399b269/fastkde-1.0.8.tar.gz" } ], "1.0.9": [ { "comment_text": "", "digests": { "md5": "0b3c2bec1037a708f774569caa3aed08", "sha256": "f3b9a47c888a9b93347abf551c21d62706eb085e467aaea50b6beec0fcf3e8a1" }, "downloads": -1, "filename": "fastkde-1.0.9.tar.gz", "has_sig": false, "md5_digest": "0b3c2bec1037a708f774569caa3aed08", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 95035, "upload_time": "2016-08-05T01:17:38", "url": "https://files.pythonhosted.org/packages/e0/07/b790f2687f542816e4161b7e6706c699c87a49cb454a40adcc244f0bb3d3/fastkde-1.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0d0c3922ecc3477180a6a3c60ccff555", "sha256": "8898d0db48947fd6431cab01175745c24243f6bd7d18741e5cea2138b4ab5fb0" }, "downloads": -1, "filename": "fastkde-1.0.13.tar.gz", "has_sig": false, "md5_digest": "0d0c3922ecc3477180a6a3c60ccff555", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 96862, "upload_time": "2017-07-20T19:05:02", "url": "https://files.pythonhosted.org/packages/1c/e5/7028b17c7efe2507b7e6ee03e3e2c35fdee2db4fab7b86d402757d6a5508/fastkde-1.0.13.tar.gz" } ] }