{ "info": { "author": "Tommaso Belluzzo", "author_email": "tommaso.belluzzo@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3 :: Only", "Topic :: Education", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Scientific/Engineering :: Physics", "Topic :: Software Development :: Libraries" ], "description": "PyDTMC is a full-featured, lightweight library for discrete-time Markov chains analysis. It provides classes and functions for creating, manipulating and simulating markovian stochastic processes.\n\n## Requirements\n\nPyDTMC supports only `Python 3` and the minimum required version is `3.6`. In addition, the environment must include the following libraries:\n\n* [Matplotlib](https://matplotlib.org/)\n* [NetworkX](https://networkx.github.io/)\n* [Numpy](https://www.numpy.org/)\n\nFor a better user experience, it's recommended to install [Graphviz](https://www.graphviz.org/) and [PyDot](https://pypi.org/project/pydot/) before using the `plot_graph` function.\n\n## Installation & Upgrade\n\nVia PyPI:\n\n```sh\n$ pip install PyDTMC\n$ pip install --upgrade PyDTMC\n```\n\nVia GitHub:\n\n```sh\n$ pip install git+https://github.com/TommasoBelluzzo/PyDTMC.git@master#egg=PyDTMC\n$ pip install --upgrade git+https://github.com/TommasoBelluzzo/PyDTMC.git@master#egg=PyDTMC\n```\n\n## Usage\n\nThe core element of the library is the `MarkovChain` class, which can be instantiated as follows:\n\n```console\n>>> import numpy as np\n>>> p = np.array([[0.2, 0.7, 0.0, 0.1], [0.0, 0.6, 0.3, 0.1], [0.0, 0.0, 1.0, 0.0], [0.5, 0.0, 0.5, 0.0]])\n>>> mc = MarkovChain(p, ['A', 'B', 'C', 'D'])\n>>> print(mc)\n\nDISCRETE-TIME MARKOV CHAIN\n SIZE: 4\n CLASSES: 2\n - RECURRENT: 1\n - TRANSIENT: 1\n ABSORBING: YES\n APERIODIC: YES\n IRREDUCIBLE: NO\n ERGODIC: NO\n```\n\nStatic values of `MarkovChain` instances can be retrieved through their properties:\n\n```console\n>>> print(mc.recurrent_states)\n['C']\n\n>>> print(mc.transient_states)\n['A', 'B', 'D']\n\n>>> print(mc.steady_states)\n[array([0., 0., 1., 0.])]\n\n>>> print(mc.fundamental_matrix)\n[[1.50943396 2.64150943 0.41509434]\n [0.18867925 2.83018868 0.30188679]\n [0.75471698 1.32075472 1.20754717]]\n\n>>> print(mc.absorption_times)\n[4.56603774 3.32075472 3.28301887]\n\n>>> print(mc.topological_entropy)\n0.6931471805599457\n```\n\nDynamic computations on `MarkovChain` instances can be performed through their methods:\n\n```console\n>>> print(mc.expected_rewards(10, [2, -3, 8, -7]))\n[-2.76071635 -12.01665113 23.23460025 -8.45723276]\n\n>>> print(mc.expected_transitions(2))\n[[0.085 0.2975 0. 0.0425]\n [0. 0.345 0.1725 0.0575]\n [0. 0. 0.7 0. ]\n [0.15 0. 0.15 0. ]]\n \n>>> print(mc.walk(10))\n['D', 'A', 'B', 'C', 'C', 'C', 'C', 'C', 'C', 'C']\n```\n\nPlotting functions can provide a visual representation of a `MarkovChain` instance; in order to display function outputs immediately, the [interactive mode](https://matplotlib.org/faq/usage_faq.html#what-is-interactive-mode) of `Matplotlib` must be turned on:\n\n```console\n>>> plot_eigenvalues(mc)\n```\n\n![Eigenplot](https://i.imgur.com/ARWWG7z.png)\n\n```console\n>>> plot_graph(mc)\n```\n\n![Graphplot](https://i.imgur.com/looxKRO.png)\n\n```console\n>>> plot_walk(mc, 10, 'sequence')\n```\n\n![Walkplot](https://i.imgur.com/oxjDYr3.png)", "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/TommasoBelluzzo/PyDTMC", "keywords": "analysis chain fitting markov models plotting probability process random simulation stochastic", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "PyDTMC", "package_url": "https://pypi.org/project/PyDTMC/", "platform": "any", "project_url": "https://pypi.org/project/PyDTMC/", "project_urls": { "Homepage": "https://github.com/TommasoBelluzzo/PyDTMC" }, "release_url": "https://pypi.org/project/PyDTMC/2.1.0/", "requires_dist": null, "requires_python": ">=3.6", "summary": "A framework for discrete-time Markov chains analysis.", "version": "2.1.0" }, "last_serial": 5689049, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "4d5101dfc4e538cfb877ad3ee7eb2e5c", "sha256": "b11e14320cb6001ab65fd7d879f4ec275601392ae5ad8e3bade4f1eec41421c2" }, "downloads": -1, "filename": "PyDTMC-0.1.2.tar.gz", "has_sig": false, "md5_digest": "4d5101dfc4e538cfb877ad3ee7eb2e5c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 27651, "upload_time": "2019-01-13T17:52:40", "url": "https://files.pythonhosted.org/packages/2c/aa/c8c3e2f0ecedc296a9ddbe3d99184ad8f866fa9e83d63168b3220ceb7a5b/PyDTMC-0.1.2.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "302c329be3cc54ab05e90a0bb01a717c", "sha256": "1162bcfa9fb71982ea131636e192ff1c4aee44057d7e12678854a6c7dd3c67e0" }, "downloads": -1, "filename": "PyDTMC-1.0.0.tar.gz", "has_sig": false, "md5_digest": "302c329be3cc54ab05e90a0bb01a717c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 27809, "upload_time": "2019-07-20T04:26:57", "url": "https://files.pythonhosted.org/packages/80/8d/ddb3ca345ac2cddd54618e7e2963daea732595c9aa148f1c1f944b6ee3b7/PyDTMC-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "977d0d5175e4987573366d0da7b810ba", "sha256": "2f4b05363b947525540806fa9e71b29b9335f4039b26de0d0496fa59a2769802" }, "downloads": -1, "filename": "PyDTMC-1.1.0.tar.gz", "has_sig": false, "md5_digest": "977d0d5175e4987573366d0da7b810ba", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 28066, "upload_time": "2019-07-20T22:45:08", "url": "https://files.pythonhosted.org/packages/5f/39/2ab34bcf1be8a91e301ccb23ca5c6a77e8cf8b8cc9791afad8e83bdb1af7/PyDTMC-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "cd9f9ee9725416012852a3bee123c597", "sha256": "f28a2d15e7b1d42d2dfa5e4dd4389f2679c99acf08bd171689e6894a7cc1430e" }, "downloads": -1, "filename": "PyDTMC-1.2.0.tar.gz", "has_sig": false, "md5_digest": "cd9f9ee9725416012852a3bee123c597", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 28090, "upload_time": "2019-07-26T21:20:44", "url": "https://files.pythonhosted.org/packages/05/a4/fc96505d1022f89be6f3a73f7f6a93d33e19ae06b60a02a3f33d4f0b95f1/PyDTMC-1.2.0.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "7be2c862723a7e5fd077887b083f2c70", "sha256": "bdba170e77268b6cf65ec305d7d371e83227d61b4cf0ed145be727847d98df6f" }, "downloads": -1, "filename": "PyDTMC-1.3.0.tar.gz", "has_sig": false, "md5_digest": "7be2c862723a7e5fd077887b083f2c70", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 27897, "upload_time": "2019-07-28T11:30:04", "url": "https://files.pythonhosted.org/packages/90/19/e93bdfd52804b20f42f4f6baa277699aa15abdb31c4f77659a8a60c68ca3/PyDTMC-1.3.0.tar.gz" } ], "1.4.0": [ { "comment_text": "", "digests": { "md5": "9a0221f5eef54c901edd9e08916b46b5", "sha256": "811a6c2c6d3f4c5ce0c113c4713ca766fcacb0f055ab50495f0778cab013df60" }, "downloads": -1, "filename": "PyDTMC-1.4.0.tar.gz", "has_sig": false, "md5_digest": "9a0221f5eef54c901edd9e08916b46b5", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 28123, "upload_time": "2019-07-28T17:09:46", "url": "https://files.pythonhosted.org/packages/d7/29/d016cc970ca59e1943ba1c2e2ed3bcf197670f3d6cc0136376b0d751fcf8/PyDTMC-1.4.0.tar.gz" } ], "1.5.0": [ { "comment_text": "", "digests": { "md5": "ee373b45a799eaf69a3470d360c6ca79", "sha256": "c6210a99a284f372e7420f4eea6c4e0ecd665e7f2bad7ffd0e6d7301cc2a4eaa" }, "downloads": -1, "filename": "PyDTMC-1.5.0.tar.gz", "has_sig": false, "md5_digest": "ee373b45a799eaf69a3470d360c6ca79", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 28144, "upload_time": "2019-07-28T21:07:33", "url": "https://files.pythonhosted.org/packages/d2/bd/4e40d630d8d4575f7a775c18fa9d7b5298ef8fd9a9e6f2dcc8912e2441aa/PyDTMC-1.5.0.tar.gz" } ], "1.6.0": [ { "comment_text": "", "digests": { "md5": "54670198f209e5e5c6f522e30a8e3c51", "sha256": "15d6df98ef00137588cc9cc3dccfddaa6cb750116c88a9b71a3c0076a66b415c" }, "downloads": -1, "filename": "PyDTMC-1.6.0.tar.gz", "has_sig": false, "md5_digest": "54670198f209e5e5c6f522e30a8e3c51", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 28307, "upload_time": "2019-08-03T22:01:11", "url": "https://files.pythonhosted.org/packages/c5/5d/abc4104e872553bcbe6e687d6e97137e4e2925eebbe313d314bc03820de8/PyDTMC-1.6.0.tar.gz" } ], "1.7.0": [ { "comment_text": "", "digests": { "md5": "3fa6447a267c32a3fc81e389992cc2a6", "sha256": "5a34a4984cfe0d0ade08ef76a5591b6db8805e68ece46c2e6b43e699fe31403b" }, "downloads": -1, "filename": "PyDTMC-1.7.0.tar.gz", "has_sig": false, "md5_digest": "3fa6447a267c32a3fc81e389992cc2a6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 28272, "upload_time": "2019-08-12T23:02:57", "url": "https://files.pythonhosted.org/packages/40/59/a865bdc0c33ed521edb849c720bec7c2bc26ba7a71599e5da91692a45223/PyDTMC-1.7.0.tar.gz" } ], "1.8.0": [ { "comment_text": "", "digests": { "md5": "b051bef1a839084c16a1c61f3b8f948b", "sha256": "fcba144440cfcb31738438054d93fe5e19bd6a66f666a7c959fdf6d7f2f68055" }, "downloads": -1, "filename": "PyDTMC-1.8.0.tar.gz", "has_sig": false, "md5_digest": "b051bef1a839084c16a1c61f3b8f948b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 28340, "upload_time": "2019-08-15T23:43:39", "url": "https://files.pythonhosted.org/packages/22/b5/aa19f1c8f2401ee1be14126adba815973943ed3a3394ea00f611642d9209/PyDTMC-1.8.0.tar.gz" } ], "1.9.0": [ { "comment_text": "", "digests": { "md5": "ccaaf0420dd1725c50799a32459077ef", "sha256": "a810f00df9359c1594a85e4ff3f2973308e77ae299947633dfaaa272409513c6" }, "downloads": -1, "filename": "PyDTMC-1.9.0.tar.gz", "has_sig": false, "md5_digest": "ccaaf0420dd1725c50799a32459077ef", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 28352, "upload_time": "2019-08-16T18:53:37", "url": "https://files.pythonhosted.org/packages/aa/47/d93947cc03e1e5d20ce554cdfbb8ab4fcc8ad655204227ca18ef4b3fa04a/PyDTMC-1.9.0.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "f746b1b64d6b8092836b23382d14fc45", "sha256": "9d354afc92f7d81f05ab94c962b02f10da1749a7fe047282a2b3e0632c7e35d9" }, "downloads": -1, "filename": "PyDTMC-2.0.0.tar.gz", "has_sig": false, "md5_digest": "f746b1b64d6b8092836b23382d14fc45", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 28347, "upload_time": "2019-08-16T18:56:17", "url": "https://files.pythonhosted.org/packages/0b/a3/0dc34aef35aed28219c78cca6a1b4f67630873ac929abf79c0d581b8471e/PyDTMC-2.0.0.tar.gz" } ], "2.1.0": [ { "comment_text": "", "digests": { "md5": "d5a01580b1ff0858fa031a2460db8eff", "sha256": "0a7068e20265c74131492c65f215793022e62276e1446bb256710654379cedbd" }, "downloads": -1, "filename": "PyDTMC-2.1.0.tar.gz", "has_sig": false, "md5_digest": "d5a01580b1ff0858fa031a2460db8eff", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 28356, "upload_time": "2019-08-16T19:01:57", "url": "https://files.pythonhosted.org/packages/56/c2/8066d41adbedb247ac44aadce9bbe15e7aca413eed86890c91622d61bced/PyDTMC-2.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d5a01580b1ff0858fa031a2460db8eff", "sha256": "0a7068e20265c74131492c65f215793022e62276e1446bb256710654379cedbd" }, "downloads": -1, "filename": "PyDTMC-2.1.0.tar.gz", "has_sig": false, "md5_digest": "d5a01580b1ff0858fa031a2460db8eff", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 28356, "upload_time": "2019-08-16T19:01:57", "url": "https://files.pythonhosted.org/packages/56/c2/8066d41adbedb247ac44aadce9bbe15e7aca413eed86890c91622d61bced/PyDTMC-2.1.0.tar.gz" } ] }