--- id: momentchi2 version: "0.1.8" license: unclear license_treatment: permissive maintenance: abandoned --- # momentchi2 — A collection of methods for computing the cdf of a weighted sum of chi-squared random variables. License: permissive · Maintenance: abandoned · Downloads: 276.6K/mo ## What it is and what it does momentchi2 provides four statistical approximation methods for computing the cumulative distribution function (CDF) of a weighted sum of chi-squared random variables. This is a specialized numerical problem in statistics where exact computation is expensive; the package trades exact accuracy for speed using moment-matching techniques. The four methods—Hall-Buckley-Eagleson, Satterthwaite-Welch, Wood's F, and Lindsay-Pilla-Basak—each have different strengths: Hall-Buckley-Eagleson is recommended for larger coefficient sets (over 100), while Lindsay-Pilla-Basak works better for smaller sets (up to 10). The package wraps scipy and numpy to deliver these approximations. You call one of the four functions with a coefficient vector and quantile value(s), and it returns the approximate CDF. Input can be a scalar, list, or numpy array; output format matches input format. The Lindsay-Pilla-Basak method accepts a tunable parameter p (default 4) to trade accuracy for speed. The package is a Python port of the R package momentchi2 and is intended for researchers and practitioners who need fast, reasonably accurate CDF approximations rather than exact solutions. Use it for: - Approximate CDF of weighted chi-squared sums in statistical hypothesis testing or variance component estimation. - Fast numerical approximation in simulation studies where exact computation would be prohibitively slow. - Selecting among four moment-matching methods based on the size of your coefficient vector and accuracy requirements. - Batch evaluation of CDF at multiple quantile points using numpy arrays for vectorized performance. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Computes the cumulative distribution function of a weighted sum of chi-squared random variables using four moment-matching approximation methods: Hall-Buckley-Eagleson, Satterthwaite-Welch, Wood's F, and Lindsay-Pilla-Basak. Yes, if you need a fast approximate CDF for weighted chi-squared sums and can tolerate two to three decimal place accuracy. No, if you require exact results, active maintenance, or modern package support—the project is abandoned (last release 2021-08-27) and may have compatibility issues with current scipy/numpy versions. Suitable for research or one-off analysis, risky for production systems. ## Install pip install momentchi2 uv add momentchi2 poetry add momentchi2 ## Installing momentchi2 Before you install: Low install friction with only numpy and scipy as dependencies. However, the package is abandoned—last release was 2021-08-27 with no updates since, so expect no maintenance or bug fixes. License in practice: MIT license (permissive) means you can use, modify, and distribute the package freely with minimal restrictions, though you must include the license notice. Quickstart: pip install momentchi2 from momentchi2 import hbe import numpy as np # Compute CDF for weighted chi-squared sum result = hbe(np.array([1.5, 1.5, 0.5, 0.5]), np.array([0.627, 10.203])) Requires Python 3.6 or later; numpy and scipy must be installed. Verify before relying: - Whether the package's accuracy claims (two to three decimal places) hold for your specific use case and coefficient configuration. - Current compatibility with modern scipy and numpy versions, given the package has not been updated since 2021. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: abandoned - Downloads: 276.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags chi-squared weighted sum cdf, moment matching approximation, chi-squared distribution, statistical approximation methods, quadratic form distribution, weighted chi-squared cdf, statistical-approximation, chi-squared, moment-matching [View on SkillFed](https://skillfed.io/packages/momentchi2) · [View on PyPI](https://pypi.org/project/momentchi2/)