spline_stats function

Computes background quantities using splines