I was trying to show that in polynomial regression, the model overfits the data when the degree of polynomial $k$ increases. To demonstrate this, I had 30 2D datapoints and $k = 1,\dots,18$. I plotted the MSE training error against $k$.
However the plot shows that the training error kept decreasing until $k=10$, after which point the error rate goes up and down randomly.
From this answer I realise the problem might be that my design matrix is ill-conditioned so the solution becomes numerically unstable.
How can I get around this problem?
Thanks.