How this calculation works
Evaluate a positive weighted sum of independent central chi-square components with a nonnegative gamma-mixture truncation diagnostic.
Q=Σw_i χ²_{d_i}; β_min=min(2w_i); Q is a nonnegative mixture of Gamma(Σd_i/2+k, β_min).A worked example
For Q=chi-square(2)+2 times chi-square(2), the default threshold 5 gives CDF≈0.5090754049, mean 6 and variance 20. The omitted gamma-mixture mass is below 1e−11.
Good to know
1–8 positive weights 0.000001–10000 and integer multiplicities 1–20; weight ratio≤50 and positive finite threshold. Central independent components only. Bounded nonnegative gamma series; omitted mixture mass must resolve below 1e−9. Reported bounds concern series truncation under floating arithmetic, not certified interval arithmetic. No negative weights, noncentrality or dependence.
Reference: CompQuadForm authors: quadratic-form distribution computation (opens in a new tab) ↗
Random quadratic forms have distributions
A deterministic quadratic form can be classified by the signs of its eigenvalues, but that classification does not give a probability. For independent standard normal coordinates, a positive weighted sum of their squares has a distribution determined by the positive weights and their multiplicities. The page evaluates its cumulative probability at a supplied threshold.
Each row represents a central chi-square variable multiplied by a positive weight. Multiplicity is its degrees of freedom, not an observation count used to estimate a parameter. Components are independent by assumption. Correlated normal coordinates must first be transformed into an appropriate eigenvalue representation outside this fixed-input probability calculation.
Compare this with the Quadratic form inertia calculator with congruence transformation. Evaluate the distribution of a random weighted sum of squared standard normals; inertia classifies signs of a deterministic quadratic form and supplies no random tail probability.
Weights define gamma shapes and scales
A central chi-square variable with d degrees of freedom is a gamma variable with shape d divided by two and scale two. Multiplying it by a positive weight changes that scale to twice the weight. The sum is generally not a single gamma variable unless all component scales are equal.
The mean is the sum of weight times degrees of freedom, and variance is twice the sum of squared weight times degrees of freedom. These simple moments are returned as checks, but a moment-matched gamma approximation is not substituted for the requested distribution. The implementation instead uses a convergent positive gamma-mixture representation.
Expand around the smallest component scale
The minimum gamma scale is used as the common base scale. A recurrence produces nonnegative mixture coefficients for increasing shape parameters, with an explicit normalizing factor. Each coefficient multiplies a gamma CDF evaluated at the same threshold. Positive coefficients make the accumulated probability monotone as more terms are included.
The sum of all mixture weights is one. The difference between one and the accumulated weights bounds the probability contribution of omitted terms, because every omitted gamma CDF lies between zero and one. That diagnostic is a series-truncation bound evaluated in floating arithmetic, not a complete guarantee against every source of numerical roundoff.
Read a probability together with its error scale
The result reports the retained CDF, a lower and upper truncation bracket and the remaining mixture mass. The survival probability is computed from one minus the retained CDF and inherits the same uncertainty scale. A tiny reported tail should not be interpreted to more precision than those diagnostics support.
The search is bounded in both the component weight ratio and the number of mixture terms. Very disparate scales can require slow convergence, so an unresolved omitted mass is rejected instead of presenting a partial sum as an accurate tail. This conservative behavior distinguishes a valid numerical domain from a merely finite input value.
Check the two-component default
The example combines a two-degree chi-square with weight one and another independent two-degree chi-square with weight two. Its mean is two plus four, or six. Its variance is four plus sixteen, or twenty, providing immediate checks that the weight has been squared in the variance formula.
At threshold five, the CDF is approximately 0.5090754049. Because each component is an exponential gamma law in this example, an independent convolution can verify the probability without using the mixture recurrence. The returned series needs only a modest number of terms and leaves less than one ten-billionth of mixture mass unaccounted for.
Positive central components are essential
Negative weights create an indefinite quadratic form whose support and numerical inversion behavior differ from a positive gamma convolution. Noncentral components likewise change the distribution, and dependent components cannot be multiplied into the assumed independent representation without an appropriate transformation. Those are different inputs, not optional labels on the same calculation.
The page also rejects zero or negative thresholds in its initial supported interface, rather than extending the displayed approximation into unsupported endpoint conventions. For a valid positive sum, probability below zero is mathematically zero, but that fact does not justify accepting a general indefinite or noncentral model through a positive-only parser.
Use analytic identities for independent verification
When all weights are equal, combining the degrees of freedom gives a single scaled chi-square distribution. Multiplying every weight and the threshold by the same positive factor must leave the CDF unchanged. These identities test parameter normalization and scaling independently of the detailed series coefficients.
Splitting one component into two independent chi-square components with the same scale and degrees summing to the original value must also preserve the answer. The calculator groups no statistical evidence from data and returns no parameter-estimation uncertainty. Its probability is conditional on the entered weights, multiplicities and independence assumptions being the intended mathematical model.
A few questions, answered
Can weights be negative?
No. The positive gamma-mixture representation does not support indefinite forms or their negative weighted terms.
What is multiplicity?
It is the integer chi-square degrees of freedom for that independent component, not a fitted sample size.
What does omitted mixture mass bound?
It bounds the contribution of terms omitted from the positive series, subject to floating arithmetic; it is not full interval-arithmetic certification.
What if all weights are equal?
The law reduces to that common weight times a chi-square variable with the summed degrees of freedom, giving a useful analytic check.