chi2comb-0.1.0
توضیحات
Linear combination of independent noncentral chi-squared random variables
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | chi2comb-0.1.0 |
| نام | chi2comb |
| نسخه کتابخانه | 0.1.0 |
| نگهدارنده | ['Danilo Horta'] |
| ایمیل نگهدارنده | ['horta@ebi.ac.uk'] |
| نویسنده | Danilo Horta |
| ایمیل نویسنده | horta@ebi.ac.uk |
| آدرس صفحه اصلی | https://github.com/limix/chi2comb-py |
| آدرس اینترنتی | https://pypi.org/project/chi2comb/ |
| مجوز | MIT |
# 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<q], where:
Q = λ₁X₁ + ... + λₙXₙ + σX₀.
Xᵢ (𝚒≠𝟶) is an independent random variable following a noncentral χ² distribution with
nᵢ degrees of freedom and noncentrality parameter λᵢ.
X₀ is an independent random variable having a standard Normal distribution.
## Install
It can be installed using the pip command
```bash
pip install chi2comb
```
## Usage
Consider the following linear combination of four random variables:
Q = 6⋅X₁ + 3⋅X₂ + 1⋅X₃ + 2⋅X₀,
where X₁, X₂, and X₃ are noncentral χ² random variables having degrees of freedom
n₁=n₂=1 and n₃=2 and noncentrality parameters λ₁=0.5 and λ₂=λ₃=0.
Let us estimate P[Q<1]:
```python
>>> 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).
نیازمندی
| مقدار | نام |
|---|---|
| >=1.11.5 | cffi |
| >=5 | pytest |
| >=0.8.0 | pytest-doctestplus |
نحوه نصب
نصب پکیج whl chi2comb-0.1.0:
pip install chi2comb-0.1.0.whl
نصب پکیج tar.gz chi2comb-0.1.0:
pip install chi2comb-0.1.0.tar.gz