Linear combination of independent noncentral chi-squared random variables
Project description
chi2comb
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
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]:
>>> 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.
Authors
License
This project is licensed under the MIT License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for chi2comb-0.0.4-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cac33e6517e58c8e819f50a8ae6271fd28b1684202e8439e872b044994e3ceb |
|
MD5 | 12efaf153c1dfa6cb21a1f8a4fcd91bd |
|
BLAKE2b-256 | f5f7e29e124c1245d70da533941b675f65323d25d64dfa10700293df63f36399 |
Hashes for chi2comb-0.0.4-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 836c8ade3034aa0495c860b3b4138ef6854cfc4ecd76dfc844a385b80ffb59ff |
|
MD5 | b4d3b222f74d1e363cc1f6bde4d2c6f3 |
|
BLAKE2b-256 | a0b31f162e5653ac109f72d792998a325d36fa8187062beacb43c4a06270559c |
Hashes for chi2comb-0.0.4-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae457f44daeb52c50baec202f3d8bb52bfe400b26597ca591542d50850bbaf55 |
|
MD5 | 65b5e0928cfddf35ed26dab63ea65038 |
|
BLAKE2b-256 | 2736b1b5b27572cccd552de2808371bd13e60e0a0b3c09ab07da49411a6bb32f |
Hashes for chi2comb-0.0.4-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fec930fe8df562013bb451039a486dbddc2d67b4bdef5d413bf3384cf6729782 |
|
MD5 | 8981cb22c8947414851a4fd3f9835f51 |
|
BLAKE2b-256 | fa26034584641f6b8689ed9ee8c8c56ebebad99d4700247d1c562f4fb05a9405 |
Hashes for chi2comb-0.0.4-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 381a0c338a4298fa17aa3af8cf04c82f0ebb78161a9adb51b37afb3f881b08b1 |
|
MD5 | bd573a8442964b5b8febd09eb110c57d |
|
BLAKE2b-256 | 621a1f489d22ee4cd8764dada8b57aebf5206311f9de91e62725a981a54d404a |
Hashes for chi2comb-0.0.4-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13f009e772314f7a3ef39526fc4943d62f794ff5a8d8313a5da91ecd12f1e0ef |
|
MD5 | 1267790b9af157ad05a1c89a70e19b15 |
|
BLAKE2b-256 | e26ffcfc0a8337493b448dd1431000253b8bb7ee040d3325e94577714ab8f1f2 |
Hashes for chi2comb-0.0.4-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccecb756cb943228c72281d88494e502a87fdbe8cd7bfbc82c8e1a16dd448ee8 |
|
MD5 | 42651b2463ecfd6a34bbce69b914ad78 |
|
BLAKE2b-256 | 72600e08d45e672e0f5aa695f831cb6e4784bf330e73b8e11e70bd2d13b182cd |
Hashes for chi2comb-0.0.4-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de4ba2546d696fe3c09407681654dd8ba6d78dbe9a962b719f25a62524b1720e |
|
MD5 | 6ecc1344a825517b391e16f49e4003f0 |
|
BLAKE2b-256 | 80906f51df7a3b8752bed5550c8ff697ca711cb2ed13e1f1abddba17744d22a2 |