Statistics & Probability / Polynomial Regression & Overfitting
FREE TO EXPLORE
LABORATORY 37 · STATISTICS & PROBABILITY

Polynomial Regression, Model Overfitting, and Bias-Variance Tradeoff

Investigate polynomial curve fitting, evaluate Vandermonde design matrices, analyze the Bias-Variance tradeoff, quantify training versus test error across polynomial degrees, and verify parameter scaling. Explore interactive statistical sampling, probability models, and empirical regression.

SAMPLE · INFER · CONVERGE

Your virtual statistics laboratory.

FITTED QUADRATIC COMPONENT Ŷ_QUAD—
SAMPLING TELEMETRY

Ready to sample with Regressor x² = 1.0.

1.0 units²
Quadratic target function f(x) = 0.5 x + 0.2 x²

Adjust Regressor x², then execute statistical trial.

Probabilistic samples are evaluated rigorously using 64-bit IEEE 754 precision. Residuals reflect ordinary least-squares regression across successive observations. Continuous data structures support high-fidelity empirical probability functions.

Statistical assumptions and distribution limits

High-degree global polynomials exhibit severe boundary oscillations (Runge's phenomenon) that invalidate extrapolation. The empirical regression of fitted quadratic components against squared regressors confirms parameter estimation with slope m = 0.2000 and R² = 1.000000.

Statistical tools & sampling modules.

Vandermonde Polynomial Matrix Builder

Constructs the n × (d + 1) Vandermonde design matrix X = [1, x, x^2, ..., x^d] for arbitrary polynomial degrees.

Non-Linear Synthetic Data Generator

Generates continuous observations Y = f(x) + ε with controllable Gaussian noise and true non-linear curvature.

Train-Test Split Partition Engine

Splits empirical observations into independent training (70%) and testing (30%) subsets to assess generalization.

Mean Squared Error Evaluator

Computes training error MSE_train and out-of-sample test error MSE_test across polynomial degrees d ∈ {1, ..., 10}.

Bias-Variance Decomposition Unit

Decomposes expected generalization error into Bias² + Variance + Irreducible Noise across Monte Carlo datasets.

Curvature Parameter Regression Unit

Performs linear regression of quadratic response versus x² to confirm the theoretical curvature slope m = 0.200.

FOLLOW THE METHOD

A reason behind every step.

Investigate polynomial curve fitting, evaluate Vandermonde design matrices, analyze the Bias-Variance tradeoff, quantify training versus test error across polynomial degrees, and verify parameter scaling. Standardized parameter settings: 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 units².

01

Configure Non-Linear Target Function and Noise

Set true underlying model to f(x) = 0.50 x + 0.20 x^2 with Gaussian noise ε ~ N(0, 0.16) on the polynomial simulation panel.

02

Generate Training and Test Partitions

Draw 1,000 observations uniformly on x ∈ [0, 5]. Randomly partition into 700 training observations and 300 out-of-sample test observations.

03

Fit Models Across Polynomial Degrees d = 1 to 10

Construct Vandermonde matrices and fit polynomial models for linear (d = 1), quadratic (d = 2), and high-order (d = 9) configurations.

04

Demonstrate the Overfitting Phenomenon

Observe that training error MSE_train monotonically decreases toward zero as d increases, while test error MSE_test explodes for d > 3 due to Runge-like oscillations.

05

Step Quadratic Regressor Across Standardized Values

Increment the squared regressor coordinate x^2 across standardized settings x^2 ∈ {1.0, 2.0, 3.0, 4.0, 5.0, 6.0}, recording the fitted quadratic contribution.

06

Conduct Linear Regression on Quadratic Curvature

Fit a linear regression line y = mx to coordinate pairs (x^2, ŷ_quad). Confirm that empirical slope m = 0.2000 validates curvature parameter estimation.

YOUR NOTEBOOK · 0 OBSERVATIONS

Turn measurements into empirical insight.

See a complete example report ↗

Points are your recorded observations. The solid regression line validates Polynomial Regression & Overfitting mathematical scaling.

LINEAR REGRESSION FIT · y = mx + b
y = 0.2000 · x
#Squared Regressor Coordinate x² (units²)Fitted Quadratic Component ŷ_quad (Component ŷ_quad)Squared Regressor Coordinate x²Fitted Quadratic Component ŷ_quadRemove

No readings yet. Execute a statistical trial and record it.

Calculate it yourself.

CHECK YOUR UNDERSTANDING

Explain what the statistical metrics mean.

What three additive components constitute the mathematical Bias-Variance decomposition of expected prediction error?

What happens to training error versus test error when a polynomial model is severely overfitted (d >> d*)?

Why does the Vandermonde matrix X = [1, x, x², ..., x^d] become numerically ill-conditioned for high degrees d?

Which model selection criterion penalizes parameter count k by k · ln(n)?