{ "info": { "author": "Alexander Butyaev", "author_email": "alexander.butyaev@mail.mcgill.ca", "bugtrack_url": null, "classifiers": [], "description": "KernSmooth for Python\n=====================\nPorting popular R library KernSmooth to python.\n\nFunctions for Kernel Smoothing and Density Estimation.\n\nTransformed R and Fortran functions into Python(2,3) code.\n\nInstallation:\n-------------\n\n.. code:: shell\n\n\t\tpip install kern-smooth\n\n\nMain function of the module:\n----------------------------\n\n.. code:: python\n \n def densCols(x, y=None, nbin=128, bandwidth=None)\n\n\nProduces a vector of numbers which encode the local densities at each point in dataset.\n\nx, y : 1D numpy array with coordinates of the points density will be estimated on\n\nnbin : [optional] int or [int, int] - number of bins along each axis\n (in case of single value - [nbin, nbin] will be used). Default value 128.\n\nbandwidth : [optional] numeric vector (len of 1 or 2) of smoothing bandwidth.\n\nReturns: numpy array with numerical representation (in range [0,1]) of point densities.\n\nAttention: For return value numpy.nan values are allowed in case of nan / infinite values in original dataset \n\nSource: R::grDevices::densCols\n\n\nUsage\n-----\n\nGenerate data for plotting\n\n.. code:: python\n\n from matplotlib import pyplot as plt\n from matplotlib import cm\n import numpy as np\n np.random.seed(0)\n # create two 'bulbs' with normal distributions\n mean1 = [0, 0]\n cov1 = [[5, 0], [0, 30]] # diagonal covariance\n x1, y1 = np.random.multivariate_normal(mean1, cov1, 50000).T\n mean2 = [5, 17]\n cov2 = [[30, 0], [0, 5]] # diagonal covariance\n x2, y2 = np.random.multivariate_normal(mean2, cov2, 50000).T\n x = np.hstack([x1,x2])\n y = np.hstack([y1,y2])\n\n\nGenerate point densities:\n\n.. code:: python\n\n from kern_smooth import densCols\n densities = densCols(x, y, nbin = 128)\n\n\nPlot the result\n\n.. code:: python\n\n sc = plt.scatter(x, y, c=densities, s=15, edgecolors='none', alpha=0.75, cmap=cm.jet)\n plt.colorbar(sc)\n plt.show()\n\n\nResult\n------\n![Result](https://github.com/AlexanderButyaev/kern_smooth/blob/master/example_density.png) \n\nAuthor\n------\nAlexander Butyaev", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/AlexanderButyaev/kern_smooth", "keywords": "statistics,probability,KDE,PDF,kernel density estimation", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "kern-smooth", "package_url": "https://pypi.org/project/kern-smooth/", "platform": "", "project_url": "https://pypi.org/project/kern-smooth/", "project_urls": { "Homepage": "https://github.com/AlexanderButyaev/kern_smooth" }, "release_url": "https://pypi.org/project/kern-smooth/1.0.12/", "requires_dist": null, "requires_python": "", "summary": "A python implementation of KernSmooth package (https://cran.r-project.org/web/packages/KernSmooth):kernel smoothing and density estimation functions based on the book: Wand, M.P. and Jones, M.C. (1995) \"Kernel Smoothing\".", "version": "1.0.12" }, "last_serial": 4887379, "releases": { "1.0.12": [ { "comment_text": "", "digests": { "md5": "7d37abbae3cd0d69fd94e240c3b8b46d", "sha256": "4f98a9dbaa205f53ec74e6523e8a3911a93e7047e4277a95f390f6aa928f417f" }, "downloads": -1, "filename": "kern-smooth-1.0.12.tar.gz", "has_sig": false, "md5_digest": "7d37abbae3cd0d69fd94e240c3b8b46d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 102086, "upload_time": "2019-03-01T23:31:02", "url": "https://files.pythonhosted.org/packages/cb/25/92201b8deb76141de6db3e67b82457faa936e56e977f002a812a762f2a0e/kern-smooth-1.0.12.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7d37abbae3cd0d69fd94e240c3b8b46d", "sha256": "4f98a9dbaa205f53ec74e6523e8a3911a93e7047e4277a95f390f6aa928f417f" }, "downloads": -1, "filename": "kern-smooth-1.0.12.tar.gz", "has_sig": false, "md5_digest": "7d37abbae3cd0d69fd94e240c3b8b46d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 102086, "upload_time": "2019-03-01T23:31:02", "url": "https://files.pythonhosted.org/packages/cb/25/92201b8deb76141de6db3e67b82457faa936e56e977f002a812a762f2a0e/kern-smooth-1.0.12.tar.gz" } ] }