Advanced maths

Polynomial chaos expansion calculator for uniform or normal inputs

Polynomial chaos expands a response in orthogonal polynomials matched to an input distribution.

Your numbers

Y=c0+c1X+…; degree ≤10.
Integer 0–10.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Polynomial chaos expands a response in orthogonal polynomials matched to an input distribution. This calculator projects a one-variable polynomial response onto Legendre or probabilists’ Hermite bases using analytic moments. It returns the retained coefficients, mean, variance and variance omitted by truncating the expansion.

THE FORMULAc_k=E[YΨ_k]/E[Ψ_k²]; E[Y]=c0; Var(Y_N)=Σ_(k=1)^N c_k² E[Ψ_k²].

A worked example

If X is uniform on [−1,1] and Y=X², then X²=(1/3)P0+(2/3)P2. The mean is 1/3 and variance is (2/3)²×(1/5)=4/45. Retaining only degree one keeps the correct mean but gives zero expansion variance and omits all 4/45.

Good to know

One standardized independent input only: uniform [−1,1] or standard normal. Response degree and expansion order ≤10. Floating-point analytic moments, ordinary Legendre or probabilists’ Hermite normalization. No data fitting, correlated multivariate inputs, distribution inference or nonpolynomial quadrature.

Match the basis to the probability measure

Orthogonality is defined using expectation under the selected input distribution. Ordinary Legendre polynomials are orthogonal for the uniform measure on [−1,1], while probabilists’ Hermite polynomials are orthogonal for the standard normal measure. Selecting the other family changes the probability model, not merely the display style of the coefficients.

For a nonstandard physical variable, a separate change of variables is needed before entering the response. For example, a uniform interval [a,b] can be mapped from a standardized input. Substitute that map into the response polynomial first; entering a raw physical polynomial while selecting a standardized distribution silently changes its moments.

The squared uniform input has one constant and one quadratic chaos componentConstant: c0 = 1/3Quadratic: c2 = 2/3E[P2] = 0; E[P2²] = 1/5Variance = 4/9 × 1/5 = 4/45No linear component: c1 = 0
For X uniform on [−1,1], X²=(1/3)P0+(2/3)P2. Mean is 1/3; variance is (2/3)²×(1/5)=4/45. A degree-one truncation keeps the mean but loses the complete variance.

The Chebyshev polynomial approximation calculator covers a related task. This page focuses on polynomial chaos expansion calculator for uniform or normal inputs with the method limits and worked example described below.

Basis norms belong in the variance formula

These bases are orthogonal but not normalized to unit squared norm. The result prints each norm alongside its coefficient. Omitting that factor gives the wrong variance even when the expansion coefficients are correct. In the uniform example, the degree-two norm is one fifth, which turns coefficient square 4/9 into variance contribution 4/45.

The constant basis coefficient gives the exact mean for the entered polynomial because every nonconstant orthogonal basis function has zero expectation. Truncating higher degrees can therefore preserve the mean while losing substantial variance. This is why the retained variance and omitted variance are reported separately rather than presenting a low-order expansion as the full distribution.

Analytic moments avoid a Monte Carlo interpretation

The projection uses polynomial products and known moments of the declared distribution. It does not draw random samples, so there is no sampling confidence interval or seed to choose. Floating-point cancellation can still affect very high moments or strongly scaled coefficients; the degree and coefficient limits keep this bounded implementation manageable.

The related Chebyshev approximation calculator targets deterministic function approximation under a different basis and weighting. Polynomial chaos here is explicitly probabilistic: expectation defines the inner product, and coefficient squares weighted by basis norms summarize uncertainty in the selected one-input model.

A few questions, answered

Why does low order underestimate variance?

It omits orthogonal components whose nonnegative variance contributions are printed as omitted variance.

Which Hermite convention is used?

The probabilists’ convention for a standard normal input, not the physicists’ convention.

Find your calculator

Start typing to explore the library.