{"id":35129169,"url":"https://github.com/areenberg/phasedist","last_synced_at":"2026-03-17T22:11:57.862Z","repository":{"id":330772818,"uuid":"833143694","full_name":"areenberg/phasedist","owner":"areenberg","description":"Fit phase-type distributions in Python","archived":false,"fork":false,"pushed_at":"2026-03-08T03:05:47.000Z","size":19777,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-08T07:41:40.830Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/areenberg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-24T12:45:47.000Z","updated_at":"2026-03-08T03:05:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/areenberg/phasedist","commit_stats":null,"previous_names":["areenberg/phasedist"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/areenberg/phasedist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areenberg%2Fphasedist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areenberg%2Fphasedist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areenberg%2Fphasedist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areenberg%2Fphasedist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/areenberg","download_url":"https://codeload.github.com/areenberg/phasedist/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areenberg%2Fphasedist/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30633241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-28T04:31:27.601Z","updated_at":"2026-03-17T22:11:57.853Z","avatar_url":"https://github.com/areenberg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cimg src=\"https://github.com/areenberg/phasedist/blob/main/images/PhaseDist_logo.png\" alt=\"Example\" width=\"300\"\u003e\n\nPhaseDist is a Python package for fitting continuous and discrete phase-type distributions.\n\n## Features\n\n* Fit continuous and discrete phase-type distributions using EM algorithms.\n* Use built-in methods to easily check the fitted distribution.\n* Evaluate various metrics, such as the mean, density, quantile function, AIC and more.\n* Simulate observations from phase-type distributions.\n* Approximate another distribution, e.g. a log-normal distribution, using a phase-type distribution.\n\n# Installation\n\nInstall directly from PyPI with:\n\n```\npip install phasedist\n```\n\n# Quick start guide\n\nThe following shows how to use PhaseDist for fitting a continuous phase-type distribution from observed data. \n\n(1) Start by loading PhaseDist (and NumPy) and defining the observed data.\n\n```python\nimport phasedist as ph\nimport numpy as np\n\nobs = np.array([1.48246359,1.13468709,0.66779536,0.61823347,0.8888217,1.10124776,0.1424737,2.1228061,\n1.73924933,0.9849647,1.4828275,1.97188842,2.56132465,1.58038807,1.27567082,2.7754917,1.42516854,0.4602795,\n1.93701091,2.50633135,1.92906099,1.60935023,1.41949599,1.14870169,0.79146146,1.31530543,1.81352371,1.17079096,\n0.78948314,1.39528837,1.62003755,1.52143826,0.46665594,1.37913488,3.10066725,0.76942733,1.42849783,1.61511175,\n2.94617609,1.53719196,1.01144357,2.00466269,0.56886361,1.62237618,0.41023332,0.78733512,4.01849928,1.27761144,\n1.09426382,1.36946933])\n```\n\n(2) Fit the data to a generalized Erlang distribution with 3 phases.\n\n```python\nfit = ph.fit(obs=obs,\n             nphases=3,\n             dtype=\"generlang\")\n```\n\n(3) Compare the CDF of the fitted distribution to the empirical CDF.\n\n```python\nfit.plot()\n```\n\n\u003cimg src=\"https://github.com/areenberg/phasedist/blob/main/images/quickstart_example_CDF.png\" alt=\"Example\" width=\"500\"\u003e\n\n(4) Store the fitted distribution in the object `phdist` and compute the mean, variance, and 95% quantile.\n\n```python\nphdist = fit.getdist()\n\nprint(phdist.getmean())\n#1.455814\n\nprint(phdist.getvar())\n#0.706466\n\nprint(phdist.getquantile(p=0.95))\n#3.055169\n```\n\nFind the complete example in the file `quickstart_example.py`.\n\n# Documentation\n\nThe documentation can be found in the [wiki for PhaseDist](https://github.com/areenberg/phasedist/wiki).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fareenberg%2Fphasedist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fareenberg%2Fphasedist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fareenberg%2Fphasedist/lists"}