Skip to main content

Test statistics from linear combination of chi-squared distributions.

Project description

chiscore

Travis AppVeyor

Estimate the joint significance of test statistics derived from linear combination of chi-squared distributions.

Install

We recommend installing it via conda:

conda install -c conda-forge chiscore

Alternatively, chiscore can also be installed using pip:

pip install chiscore

Running the tests

After installation, you can test it

python -c "import chiscore; chiscore.test()"

as long as you have pytest.

Usage

>>> from chiscore import davies_pvalue
>>> q = 1.5
>>> w = [[0.3, 5.0], [5.0, 1.5]]
>>> davies_pvalue(q, w)
{'p_value': 0.6151796819770086, 'param': {'liu_pval': 0.6151796819770086, 'Is_Converged': 1.0}, 'p_value_resampling': None, 'pval_zero_msg': None}
>>> from chiscore import mod_liu
>>> q = 1.5
>>> w = [0.3, 5.0]
>>> mod_liu(q, w)
(0.6230031759923031, 5.3, 7.083784299369935, 1.0071999066892092)
>>> from chiscore import optimal_davies_pvalue
>>> q = [1.5, 3.0]
>>> mu = -0.5
>>> var = 1.0
>>> kur = 3.0
>>> w = [10.0, 0.2, 0.1, 0.3]
>>> remain_var = 0.5
>>> df = 3.4
>>> trho = [5.1, 0.2]
>>> grid = [0., 0.01]
>>> optimal_davies_pvalue(q, mu, var, kur, w, remain_var, df, trho, grid)
0.966039962464624

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

chiscore-0.0.14.tar.gz (44.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page