Just thought I'd suggest you add a GP model as a comparison to splines. If you look at my fork, I've done the legwork code-wise, but haven't added any text to describe what's going on. The GP takes much longer to fit, as would be expected, but seems to fare better than even the penalized splines model at recovering the true function.