{ "info": { "author": "mirca", "author_email": "jvmirca@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6" ], "description": "Simulation of generalized fading channels in Python\n===================================================\n\nLet's say you have a complicated density function for which there is no implementation in ``Scipy``, e.g., Yacoub's Kappa-Mu.\nDon't worry, **maoud** got you covered::\n\n import numpy as np\n import scipy.special as sps\n\n def kappa_mu_pdf(x, kappa, mu):\n return (2.0 * mu * np.power(1.0 + kappa, (mu + 1.0) / 2.0) * np.power(x, mu)\n * np.exp(-mu * (1.0 + kappa) * x * x - mu * kappa + 2 * x * mu\n * np.sqrt(kappa * (1.0 + kappa))) * sps.ive(mu - 1, 2 * mu * x\n * np.sqrt(kappa * (1.0 + kappa))) / (np.power(kappa, (mu - 1.0) / 2.0)))\n\nThen you want to do the following in order to draw samples::\n\n from maoud.sampling import rejection_sampling\n\n n_samples = int(1e6)\n kappa = 0.75\n mu = 0.87\n low = 1e-6\n high = 3\n\n kappa_mu_samples, af = rejection_sampling(kappa_mu_pdf, low, high,\n n_samples, kappa, mu)\n\nTo verify that the samples are in accordance with Yacoub's Kappa-Mu density, let's plot the histogram of the samples::\n\n import matplotlib.pyplot as plt\n\n x = np.linspace(1e-6, 3, 1000)\n y = kappa_mu_pdf(x, kappa, mu)\n\n plt.plot(x, y)\n plt.hist(kappa_mu_samples, bins=50, normed=True)\n\n.. image:: https://github.com/mirca/acceptance-rejection/raw/master/kappa_mu.png\n\nSHAZAM!!\n\nCitation\n========\n\nIf you made use of the code available in this repository, please consider\nciting the following work::\n\n @ARTICLE{7986939,\n author={J. V. M. Cardoso and W. J. L. Queiroz and H. Liu and M. S. Alencar},\n journal={Tsinghua Science and Technology},\n title={On the performance of the energy detector subject to impulsive noise in \u03ba\u2014\u03bc, \u03b1\u2014\u03bc, and \u03b7\u2014\u03bc fading channels},\n year={2017},\n volume={22},\n number={4},\n pages={360-367},\n doi={10.23919/TST.2017.7986939},\n month={Aug},}", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mirca/maoud", "keywords": "statistics probability", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "maoud", "package_url": "https://pypi.org/project/maoud/", "platform": "", "project_url": "https://pypi.org/project/maoud/", "project_urls": { "Homepage": "https://github.com/mirca/maoud" }, "release_url": "https://pypi.org/project/maoud/0.1.dev0/", "requires_dist": null, "requires_python": "", "summary": "Simulating generalized fading channels", "version": "0.1.dev0" }, "last_serial": 3860783, "releases": { "0.1.dev0": [ { "comment_text": "", "digests": { "md5": "fe65eb8d691c64973efbdb0ed6d0b561", "sha256": "8a9b5af6eb3411b4efd747e623bd5989b30068791c727721775c6050d4856a2e" }, "downloads": -1, "filename": "maoud-0.1.dev0.tar.gz", "has_sig": false, "md5_digest": "fe65eb8d691c64973efbdb0ed6d0b561", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4724, "upload_time": "2018-05-14T12:39:54", "url": "https://files.pythonhosted.org/packages/e0/f0/4a4456fd97fb966a635e22f88e035c7d6fb706ebb039d6340d1716556593/maoud-0.1.dev0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fe65eb8d691c64973efbdb0ed6d0b561", "sha256": "8a9b5af6eb3411b4efd747e623bd5989b30068791c727721775c6050d4856a2e" }, "downloads": -1, "filename": "maoud-0.1.dev0.tar.gz", "has_sig": false, "md5_digest": "fe65eb8d691c64973efbdb0ed6d0b561", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4724, "upload_time": "2018-05-14T12:39:54", "url": "https://files.pythonhosted.org/packages/e0/f0/4a4456fd97fb966a635e22f88e035c7d6fb706ebb039d6340d1716556593/maoud-0.1.dev0.tar.gz" } ] }