{"id":21433554,"url":"https://github.com/limix/chi2comb-py","last_synced_at":"2025-07-14T13:31:18.293Z","repository":{"id":60720816,"uuid":"149168254","full_name":"limix/chi2comb-py","owner":"limix","description":"Python package for linear combination of independent noncentral chi-squared random variables.","archived":false,"fork":false,"pushed_at":"2020-09-16T13:52:05.000Z","size":26,"stargazers_count":11,"open_issues_count":6,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-10T05:42:39.966Z","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/limix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-17T18:14:19.000Z","updated_at":"2024-03-12T08:04:20.000Z","dependencies_parsed_at":"2022-10-03T18:53:53.135Z","dependency_job_id":null,"html_url":"https://github.com/limix/chi2comb-py","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limix%2Fchi2comb-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limix%2Fchi2comb-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limix%2Fchi2comb-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limix%2Fchi2comb-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/limix","download_url":"https://codeload.github.com/limix/chi2comb-py/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225980902,"owners_count":17554919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-11-22T23:28:46.308Z","updated_at":"2024-11-22T23:28:46.934Z","avatar_url":"https://github.com/limix.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chi2comb\n\n[![Travis](https://img.shields.io/travis/com/limix/chi2comb-py.svg?style=flat-square\u0026label=linux%20%2F%20macos%20build)](https://travis-ci.com/limix/chi2comb-py) [![AppVeyor](https://img.shields.io/appveyor/ci/Horta/chi2comb-py.svg?style=flat-square\u0026label=windows%20build)](https://ci.appveyor.com/project/Horta/chi2comb-py)\n\nThis package estimates cumulative density functions of linear combinations of\nindependent noncentral χ² random variables and a standard Normal distribution.\nFormally, it estimates P[Q\u003cq], where:\n\n    Q = λ₁X₁ + ... + λₙXₙ + σX₀.\n\nXᵢ (𝚒≠𝟶) is an independent random variable following a noncentral χ² distribution with\nnᵢ degrees of freedom and noncentrality parameter λᵢ.\nX₀ is an independent random variable having a standard Normal distribution.\n\n## Install\n\nIt can be installed using the pip command\n\n```bash\npip install chi2comb\n```\n\n## Usage\n\n\nConsider the following linear combination of four random variables:\n\n    Q = 6⋅X₁ + 3⋅X₂ + 1⋅X₃ + 2⋅X₀,\n\nwhere X₁, X₂, and X₃ are noncentral χ² random variables having degrees of freedom\nn₁=n₂=1 and n₃=2 and noncentrality parameters λ₁=0.5 and λ₂=λ₃=0.\nLet us estimate P[Q\u003c1]:\n\n```python\n\u003e\u003e\u003e from chi2comb import chi2comb_cdf, ChiSquared\n\u003e\u003e\u003e\n\u003e\u003e\u003e gcoef = 2\n\u003e\u003e\u003e ncents = [0.5, 0, 0]\n\u003e\u003e\u003e q = 1\n\u003e\u003e\u003e dofs = [1, 1, 2]\n\u003e\u003e\u003e coefs = [6, 3, 1]\n\u003e\u003e\u003e chi2s = [ChiSquared(coefs[i], ncents[i], dofs[i]) for i in range(3)]\n\u003e\u003e\u003e result, errno, info = chi2comb_cdf(q, chi2s, gcoef)\n\u003e\u003e\u003e result\n0.050870657088644244\n\u003e\u003e\u003e errno\n0\n\u003e\u003e\u003e info\nInfo(emag=0.6430413191446991, niterms=43, nints=1, intv=0.03462571527167856, truc=1.4608856930426104, sd=0.0, ncycles=21)\n```\n\nThe estimated value is P[Q\u003c1] ≈ 0.0587.\n\n## Problems\n\nIf you encounter any issue, please, [submit it](https://github.com/limix/chi2comb-py/issues/new).\n\n## Authors\n\n* [Danilo Horta](https://github.com/horta)\n\n## License\n\nThis project is licensed under the [MIT License](https://raw.githubusercontent.com/limix/chi2comb-py/master/LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimix%2Fchi2comb-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flimix%2Fchi2comb-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimix%2Fchi2comb-py/lists"}