Closed shyimo closed 3 years ago
In your setup above you are using identical starting values for tau1
and tau2
by setting tau0=[1.0, 1.0]
. In consequence, the factors for beta2
and beta3
are equal, thus degenerating the model. The stepwise calibration algorithm will probably not be able to recover from a broken start. I recommend you try different starting values, e.g. tau0=[1.0, 2.0]
.
Furthermore, you currently try to estimate 6 parameters (4 betas + 2 taus) from only 5 data points. You cannot expect this to yield proper estimates. I suggest you either try a NelsonSiegelCurve
(no Svensson, only 4 parameters). Or you fix the parameters tau1
and tau2
to any values you deem sensible and use nelson_siegel_svensson.calibrate.betas_nss_ols for calibration.
The intuition for tau1
and tau2
is the time points (i.e. typically years) where the curve can exhibit "humps". So you want to place them at time points where the curve is expected to be particularly non-linear. For example, you might want to have a hump at the short end tau1=0.5
and at some medium maturity tau2=4
.
Hi @luphord, Thanks for clarify that. everything works now as expected.
Thanks!
Description
unexpected results of
calibrate_nss_ols
calibration functionWhat I Did