AbstractThe term structure of interest rates is a fundamental decision–making tool for various economic activities. Despite the huge number of contributions in the field, the development of a reliable framework for both fitting and forecasting under various market conditions (either stable or very volatile) still remains a topical issue. Motivated by this problem, this study introduces a methodology relying on optimal time–varying parameters for three and five factor models in the Nelson–Siegel class that can be employed for an effective in-sample fitting and out–of–sample forecasting of the term structure. In detail, for the in–sample fitting we discussed a two–step estimation procedure leading to optimal models parameters and evaluated the performances of this approach in terms of flexibility and fitting accuracy gains. For what it concerns the forecasting, we suggest an approach overcoming the well–known issue between the stability of factor models’ parameters and the optimal dynamic decay terms. To such aim, we use either autoregressive or machine learning techniques as local data generating processes based on the optimal parameters time series derived in the in–line fitting step. The so–obtained values are then employed to get day–ahead predictions of the yield curve. We assessed the proposed framework on daily spot rates of the BRICS (Brazil, Russia, India, China and South Africa) bond market. The experimental analysis illustrated that (i) time–varying parameters ensure a significant boost in the models fitting power and a more faithful representation of the yield curves dynamics; (ii) the proposed approach provides also stable and accurate predictions.