{"library":"momentchi2","title":"momentchi2","description":"A Python library for computing the cumulative distribution function (CDF) of a weighted sum of chi-squared random variables. Version 0.1.8 supports Imhof's method, Davies' method, and moment-based approximations. Developed by the PyPA, with monthly or less frequent releases.","language":"python","status":"active","last_verified":"Mon Apr 27","install":{"commands":["pip install momentchi2"],"cli":null},"imports":["import momentchi2"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import momentchi2\n\n# Example: CDF of a weighted sum of chi-squared variables\n# weights and degrees of freedom\ndf = [1, 2, 1]\nweights = [0.5, 0.3, 0.2]\nq = 1.5\n\n# Use Imhof's method\np = momentchi2.imhof(q, weights, df)\nprint(f\"CDF value: {p:.6f}\")","lang":"python","description":"Compute the CDF of a weighted sum of chi-squared random variables using Imhof's method. For other methods (e.g., Davies, moment-based), replace imhof with davies or moment_approximation.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}