{"id":21433581,"url":"https://github.com/limix/chi2comb","last_synced_at":"2026-01-03T10:32:11.808Z","repository":{"id":60720815,"uuid":"148680837","full_name":"limix/chi2comb","owner":"limix","description":"Linear combination of independent noncentral chi-squared random variables.","archived":false,"fork":false,"pushed_at":"2020-12-17T22:49:12.000Z","size":48,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-23T08:45:22.561Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","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-13T18:31:21.000Z","updated_at":"2024-03-16T07:21:55.000Z","dependencies_parsed_at":"2022-10-03T18:53:48.915Z","dependency_job_id":null,"html_url":"https://github.com/limix/chi2comb","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limix%2Fchi2comb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limix%2Fchi2comb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limix%2Fchi2comb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limix%2Fchi2comb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/limix","download_url":"https://codeload.github.com/limix/chi2comb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243945525,"owners_count":20372894,"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:51.713Z","updated_at":"2026-01-03T10:32:11.771Z","avatar_url":"https://github.com/limix.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chi2comb\n\n[![Travis](https://img.shields.io/travis/com/limix/chi2comb/master.svg?style=flat-square\u0026label=linux%20%2F%20macos%20build)](https://travis-ci.com/limix/chi2comb) [![AppVeyor](https://img.shields.io/appveyor/ci/Horta/chi2comb.svg?style=flat-square\u0026label=windows%20build)](https://ci.appveyor.com/project/Horta/chi2comb)\n\nCumulative density function of linear combinations of independent chi-square random\nvariables and a standard Normal distribution.\n\nAs of now, this is basically a repackaging of the `davies` function implemented in the\n[CompQuadForm](https://cran.r-project.org/package=CompQuadForm) library for R.\n\n## Requirements\n\nIt requires an C compiler toolchain that supports the C11 standard and the\n[cmake](https://cmake.org/) software for orchestrating the building process.\n\n## Install\n\nYou can install it via `conda`:\n\n```bash\nconda install -c conda-forge chi2comb\n```\n\nA second installation option would be to download the latest source and to build it by\nyourself.\nOn Linux or macOS systems it can be as simple as:\n\n```bash\nbash \u003c(curl -fsSL https://raw.githubusercontent.com/limix/chi2comb/master/install)\n```\n\nSimilarly, on Windows you can install by entering in the terminal:\n\n```powershell\npowershell -Command \"(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/limix/chi2comb/master/install.bat', 'install.bat')\" \u0026\u0026 install.bat\n```\n\n## Documentation\n\nThis library exports a single function:\n\n```C\n/** Cumulative distribution function of non-central chi-squared distributions.\n *\n * Computes P[Q\u003cq] where Q=λ₁X₁ + ... + λₙXₙ + σ X₀. Xᵢ is an independent random variable\n * having a non-central chi-squared distribution with nᵢ degrees of freedom and\n * non-centrality parameter δ²ⱼ. X₀ is an independent random variable having a standard\n * Gaussian distribution.\n *\n * Parameters\n * ----------\n * q : double\n *     Value point at which distribution function is to be evaluated.\n * chi2s : struct chi2comb_chisquareds\n *     Chi-squared distributions.\n * gcoef : double\n *     Coefficient of the standard Normal distribution.\n * lim : int\n *     Maximum number of integration terms.\n * abstol : double\n *     Absolute error tolerance.\n * info : struct chi2comb_info*\n *     Algorithm information.\n * result : double *\n *     Estimated c.d.f. evaluated at `q`.\n *\n * Returns\n * -------\n * error : int\n *     0: completed successfully\n *     1: required accuracy not achieved\n *     2: round-off error possibly significant\n *     3: invalid parameters\n *     4: unable to locate integration parameters\n *     5: out of memory\n */\nCHI2COMB_API int chi2comb_cdf(double q, struct chi2comb_chisquareds *chi2s, double gcoef,\n                              int lim, double abstol, struct chi2comb_info *info,\n                              double *result);\n```\n\nThe structure\n\n```C\nstruct chi2comb_chisquareds {\n    const double *coefs;  /* chi-squared coefficients */\n    const double *ncents; /* noncentrality parameters */\n    const int *dofs;      /* degree of freedoms */\n    int n;                /* number of terms */\n};\n```\n\nrepresents a list of\n[Noncentral chi-squared distributions](https://en.wikipedia.org/wiki/Noncentral_chi-squared_distribution)\nand their coefficients.\n\nThe structure\n\n```C\nstruct chi2comb_info {\n    double emag; /* error magnitude */\n    int niterms; /* total number of integration terms */\n    int nints;   /* number of integrations */\n    double intv; /* integration interval in final integration */\n    double truc; /* truncation point in initial integration */\n    double sd;   /* s.d. of initial convergence factor */\n    int ncycles; /* cycles to locate integration parameters */\n};\n```\n\nstores information about the optimisation method for estimating the c.d.f.\n\n## Acknowledgments\n\n- P. Lafaye de Micheaux for creating the amazing CompQuadForm library for R.\n\n## Authors\n\n- [Danilo Horta](https://github.com/horta)\n\n## License\n\nThis project is licensed under the\n[MIT License](https://raw.githubusercontent.com/limix/chi2comb/master/LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimix%2Fchi2comb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flimix%2Fchi2comb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimix%2Fchi2comb/lists"}