A model can be wrong because it is too simple, or because it chases noise. Fit the same model to 60 different samples and see both kinds of error with your own eyes.
Bias is how far the average fit sits from the truth: a model that is too simple misses the shape the same way every time. Variance is how much the fits differ from each other when the training sample changes: a flexible model follows the noise in whichever sample it sees. Raise the degree and watch the cyan average hug the white curve while the thin lines spread out.
Training error only measures how well the model fits the sample it saw, so more flexibility almost always lowers it. Test error also pays for variance. The table compares them at several degrees, using your current settings.
All numbers are averages over the 60 simulated training sets. The highlighted row is your current degree.
Here, a higher polynomial degree. Bias usually falls and variance usually rises.
Ridge λ shrinks coefficients. It typically lowers variance at the cost of some extra bias.
Variance usually falls. Bias from a model that is too simple does not.
These are tendencies, not guarantees. Move each slider and read the tiles to see them on this problem.
Numbers below come from the same 60 simulated datasets as the picture. Because they are estimated from 60 samples, they carry some Monte Carlo error.
The equation holds pointwise, at each x. The expectations are over the randomness of the training set, and the test observation y = f(x) + ε has fresh, independent, zero-mean noise with variance σ², independent of the training set. Averaging the three terms over the test grid gives the numbers below. The noise floor σ² is the theoretical minimum expected test MSE under this data-generating process, reached only by predicting f(x) exactly. A fitted model generally will not attain it.
Fit a straight line (degree 1) to the smooth curve. Do the 60 fits agree with each other, and do they agree with the truth?
Degree 12 with only 15 noisy points. Watch the fits scatter from sample to sample.
Keep a flexible model (degree 9) and raise the sample size from 15 to 80. See which error term moves.