https://github.com/limix/chi2comb-py
Python package for linear combination of independent noncentral chi-squared random variables.
https://github.com/limix/chi2comb-py
Last synced: 6 months ago
JSON representation
Python package for linear combination of independent noncentral chi-squared random variables.
- Host: GitHub
- URL: https://github.com/limix/chi2comb-py
- Owner: limix
- License: mit
- Created: 2018-09-17T18:14:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-16T13:52:05.000Z (over 4 years ago)
- Last Synced: 2024-11-10T05:42:39.966Z (6 months ago)
- Language: Python
- Size: 25.4 KB
- Stars: 11
- Watchers: 3
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# chi2comb
[](https://travis-ci.com/limix/chi2comb-py) [](https://ci.appveyor.com/project/Horta/chi2comb-py)
This package estimates cumulative density functions of linear combinations of
independent noncentral χ² random variables and a standard Normal distribution.
Formally, it estimates P[Q>> from chi2comb import chi2comb_cdf, ChiSquared
>>>
>>> gcoef = 2
>>> ncents = [0.5, 0, 0]
>>> q = 1
>>> dofs = [1, 1, 2]
>>> coefs = [6, 3, 1]
>>> chi2s = [ChiSquared(coefs[i], ncents[i], dofs[i]) for i in range(3)]
>>> result, errno, info = chi2comb_cdf(q, chi2s, gcoef)
>>> result
0.050870657088644244
>>> errno
0
>>> info
Info(emag=0.6430413191446991, niterms=43, nints=1, intv=0.03462571527167856, truc=1.4608856930426104, sd=0.0, ncycles=21)
```The estimated value is P[Q<1] ≈ 0.0587.
## Problems
If you encounter any issue, please, [submit it](https://github.com/limix/chi2comb-py/issues/new).
## Authors
* [Danilo Horta](https://github.com/horta)
## License
This project is licensed under the [MIT License](https://raw.githubusercontent.com/limix/chi2comb-py/master/LICENSE.md).