{ "info": { "author": "Angus Williams", "author_email": "anguswilliams91@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# decentralise\n[![Build Status](https://travis-ci.org/anguswilliams91/decentralise.svg?branch=master)](https://travis-ci.org/anguswilliams91/decentralise)\n[![codecov](https://codecov.io/gh/anguswilliams91/decentralise/branch/master/graph/badge.svg)](https://codecov.io/gh/anguswilliams91/decentralise)\n\n\n\nMake (some) Stan programs non-centered automatically.\n\nInspired by reading [this paper](https://arxiv.org/abs/1906.03028).\n\n## Installation\n\nRequires python 3.6+.\nInstall with `pip`:\n\n```bash\npip install decentralise\n```\n\n## Example\n\nThis package provides a command line tool: `decentralise`, which is used as follows:\n\n```bash\ndecentralise \n```\n\nIt will take any normally distributed parameters that have variances that are themselves parameters, and reparameterise them to make them non-centered.\nFor example, the canonical eight schools code is:\n\n```\ndata {\n int J; // number of schools\n vector[J] y; // estimated treatment effects\n vector[J] sigma; // s.e. of effect estimates\n}\nparameters {\n real mu;\n real tau;\n vector[J] theta;\n}\nmodel {\n theta ~ normal(mu, tau);\n y ~ normal(theta, sigma);\n}\n```\n\nOnce `decentralise` is applied, this program becomes\n\n```\ndata {\n int J; // number of schools\n vector[J] y; // estimated treatment effects\n vector[J] sigma; // s.e. of effect estimates\n}\nparameters {\n real mu;\n real tau;\n vector[J] theta_std;\n}\ntransformed parameters {\n vector[J] theta = mu + theta_std * tau;\n}\nmodel {\n theta_std ~ normal(0, 1);\n y ~ normal(theta, sigma);\n}\n```\n\nI wrote this tool for fun, and have not thoroughly tested it.\nFor example, it will fail for any parameters whose sampling statements are not vectorised.\ne.g.:\n```\nx ~ normal(mu, tau);\n```\nwill work, but \n```\nfor i in (1:n) {\n x[i] ~ normal(mu, tau);\n}\n```\nwill not.\nThere are probably a ton of other cases where it will break that I have not anticipated, as well!\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/anguswilliams91/decentralise/archive/master.zip", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/anguswilliams91/decentralise", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "decentralise", "package_url": "https://pypi.org/project/decentralise/", "platform": "", "project_url": "https://pypi.org/project/decentralise/", "project_urls": { "Download": "https://github.com/anguswilliams91/decentralise/archive/master.zip", "Homepage": "https://github.com/anguswilliams91/decentralise" }, "release_url": "https://pypi.org/project/decentralise/0.0.1/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Make normally distributed parameters non-centered in Stan programs.", "version": "0.0.1" }, "last_serial": 5695146, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "082f2bd8bcd5a61f330e4ed944f62e6b", "sha256": "fcf3f3bd6d2099d1159eb4691324fdfdcc94ad7ed2da0705ea085666229a86e2" }, "downloads": -1, "filename": "decentralise-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "082f2bd8bcd5a61f330e4ed944f62e6b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 4984, "upload_time": "2019-08-18T16:31:58", "url": "https://files.pythonhosted.org/packages/dc/81/49be6aba7250c93124ba449218974c439e58a69384e249edf942c7790b3f/decentralise-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b16caa4b2460134d8e5940bd4a386114", "sha256": "3b791d798a6da86aa0971f58ff6ebd6d6f385a58bd0c965937da7c573d63cfac" }, "downloads": -1, "filename": "decentralise-0.0.1.tar.gz", "has_sig": false, "md5_digest": "b16caa4b2460134d8e5940bd4a386114", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 6677, "upload_time": "2019-08-18T16:32:01", "url": "https://files.pythonhosted.org/packages/d4/2e/a091da9ec70d8dacaea91be8aac0f64d03f55d21cbd86d77ccacb08a7336/decentralise-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "082f2bd8bcd5a61f330e4ed944f62e6b", "sha256": "fcf3f3bd6d2099d1159eb4691324fdfdcc94ad7ed2da0705ea085666229a86e2" }, "downloads": -1, "filename": "decentralise-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "082f2bd8bcd5a61f330e4ed944f62e6b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 4984, "upload_time": "2019-08-18T16:31:58", "url": "https://files.pythonhosted.org/packages/dc/81/49be6aba7250c93124ba449218974c439e58a69384e249edf942c7790b3f/decentralise-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b16caa4b2460134d8e5940bd4a386114", "sha256": "3b791d798a6da86aa0971f58ff6ebd6d6f385a58bd0c965937da7c573d63cfac" }, "downloads": -1, "filename": "decentralise-0.0.1.tar.gz", "has_sig": false, "md5_digest": "b16caa4b2460134d8e5940bd4a386114", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 6677, "upload_time": "2019-08-18T16:32:01", "url": "https://files.pythonhosted.org/packages/d4/2e/a091da9ec70d8dacaea91be8aac0f64d03f55d21cbd86d77ccacb08a7336/decentralise-0.0.1.tar.gz" } ] }