Yield curve forecasting

One of my Ph.D papers was published recently. It deals with yield curve forecasting.
Here is the code for applying the Nelson-Siegel model to any yield curve.

The previous function returns an out-of-sample residual matrix. The paper maintains that there is still information contained in those residuals, and that this information can be extracted to improve forecasting performance, like so:

When used, please cite. Enjoy.

Here is a 5 minutes long presentation about the paper: