{ "info": { "author": "Akimitsu INOUE", "author_email": "akimitsu.inoue@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.5", "Topic :: Scientific/Engineering :: Mathematics" ], "description": "# cyclicmodel\nStatistical causal discovery based on cyclic model. \nThis project is under development.\n\n## Summary\nPython package that performs statistical causal discovery\nunder the following condition:\n1. there are unobserved common factors\n2. two-way causal relationship exists\n\n`cyclicmodel` has been developed based on\n[`bmlingam`][4670f282], which implemented bayesian mixed LiNGAM.\n\n [4670f282]: https://github.com/taku-y/bmlingam \"bmlingam\"\n\n## Example\n```Python\nimport numpy as np\nimport pymc3 as pm\nimport cyclicmodel as cym\n\n# Generate synthetic data,\n# which assumes causal relation from x1 to x2\nn = 200\nx1 = np.random.randn(n)\nx2 = x1 + np.random.uniform(low=-0.5, high=0.5, size=n)\nxs = np.vstack([x1, x2]).T\n\n# Model settings\nhyper_params = cym.define_model.CyclicModelParams(\n dist_std_noise='log_normal',\n df_indvdl=8.0,\n dist_l_cov_21='uniform, -0.9, 0.9',\n dist_scale_indvdl='uniform, 0.1, 1.0',\n dist_beta_noise='uniform, 0.5, 6.0')\n\n# Generate PyMC3 model\nmodel = cym.define_model.get_pm3_model(xs, hyper_params, verbose=10)\n\n# Run variational inference with PyMC3\nwith model:\n fit = pm.FullRankADVI().fit(n=100000)\n trace = fit.sample(1000, include_transformed=True)\n\n# Check the posterior mean of the coefficients\nprint(np.mean(trace['b_21'])) # from x1 to x2\nprint(np.mean(trace['b_12'])) # from x2 to x1\n```\n\n## Installation\n```bash\npip install cyclicmodel\n```\n\n## References\n- [LiNGAM - Discovery of non-gaussian linear causal models](https://sites.google.com/site/sshimizu06/lingam)\n- [Shimizu, S., & Bollen, K. (2014). Bayesian estimation of causal direction in acyclic structural equation models with individual-specific confounder variables and non-Gaussian distributions. Journal of Machine Learning Research, 15(1), 2629-2652.](http://jmlr.org/papers/volume15/shimizu14a/shimizu14a.pdf)\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/inoueakimitsu/cyclicmodel", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "cyclicmodel", "package_url": "https://pypi.org/project/cyclicmodel/", "platform": "", "project_url": "https://pypi.org/project/cyclicmodel/", "project_urls": { "Homepage": "https://github.com/inoueakimitsu/cyclicmodel" }, "release_url": "https://pypi.org/project/cyclicmodel/0.0.4/", "requires_dist": [ "theano", "numpy", "pymc3" ], "requires_python": "", "summary": "statistical causality discovery based on cyclic model", "version": "0.0.4" }, "last_serial": 3960134, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "befcbd8f550166c1269dbac5850299a3", "sha256": "625b4f0d78a1d0a970f19e2a9449207a1100adf67e2d5624306573eb736e188d" }, "downloads": -1, "filename": "cyclicmodel-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "befcbd8f550166c1269dbac5850299a3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6168, "upload_time": "2018-06-14T05:38:45", "url": "https://files.pythonhosted.org/packages/b6/66/5eaec8333381521700f2174b721a4607080550cbc1778fc08a93a36f43c7/cyclicmodel-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "104ef7d2fb32ea1b5a40a1005b036c9f", "sha256": "091d449e57f46ff4e2e541fff6a1634f481ca5b90455a6cd5fef291ed2015eb9" }, "downloads": -1, "filename": "cyclicmodel-0.0.1.tar.gz", "has_sig": false, "md5_digest": "104ef7d2fb32ea1b5a40a1005b036c9f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5342, "upload_time": "2018-06-14T05:38:46", "url": "https://files.pythonhosted.org/packages/29/95/a547ac67d9c81acc7b64f079090381e2e4f8d1acf60582db42c08b56839f/cyclicmodel-0.0.1.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "3a9f354a5e5f29df45804962014f79b0", "sha256": "b9009ad8e98e2bea3968886e607a30df28e24346ed45f5b3a91b3d95034a9b5c" }, "downloads": -1, "filename": "cyclicmodel-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "3a9f354a5e5f29df45804962014f79b0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5551, "upload_time": "2018-06-14T05:58:28", "url": "https://files.pythonhosted.org/packages/42/86/d7ab4925b36320c602b97057b4b39aaaa81a08cea8d31dfce1623a442b0a/cyclicmodel-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "94b9ec0d8f19f086d83c7f9d5fc86442", "sha256": "98a7c74e285fb7050e27ea29151f02e7a2e5d18c6a30358bb3639395f170237e" }, "downloads": -1, "filename": "cyclicmodel-0.0.4.tar.gz", "has_sig": false, "md5_digest": "94b9ec0d8f19f086d83c7f9d5fc86442", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5361, "upload_time": "2018-06-14T05:58:29", "url": "https://files.pythonhosted.org/packages/d1/6f/a581c5effe5598ac2ba04ff889867f7340903734a580d2876204ecc0d8a1/cyclicmodel-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3a9f354a5e5f29df45804962014f79b0", "sha256": "b9009ad8e98e2bea3968886e607a30df28e24346ed45f5b3a91b3d95034a9b5c" }, "downloads": -1, "filename": "cyclicmodel-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "3a9f354a5e5f29df45804962014f79b0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5551, "upload_time": "2018-06-14T05:58:28", "url": "https://files.pythonhosted.org/packages/42/86/d7ab4925b36320c602b97057b4b39aaaa81a08cea8d31dfce1623a442b0a/cyclicmodel-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "94b9ec0d8f19f086d83c7f9d5fc86442", "sha256": "98a7c74e285fb7050e27ea29151f02e7a2e5d18c6a30358bb3639395f170237e" }, "downloads": -1, "filename": "cyclicmodel-0.0.4.tar.gz", "has_sig": false, "md5_digest": "94b9ec0d8f19f086d83c7f9d5fc86442", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5361, "upload_time": "2018-06-14T05:58:29", "url": "https://files.pythonhosted.org/packages/d1/6f/a581c5effe5598ac2ba04ff889867f7340903734a580d2876204ecc0d8a1/cyclicmodel-0.0.4.tar.gz" } ] }