We suggest an explicit solution to the graduation problem that aims at designing an optimal curve fit which simultaneously behaves as a smoothing B-spline in each time interval and as the Hodrick-Prescott filter in the knots We also outline its numerical performance and compare it to the existing estimates of the standard Hodrick-Prescott filter.