Hello,
I am attempting to fit a time series model for yield curves called the Nelson Siegel model.
It is defined on the fifth page of this paper Dynamic Nelson Siegel Paper.
I’m wanting to update the betas based on the AR(1) model, given in the Stan manual but I’ve run into divergent transition issues and extremely low effective sample sizes.
The updating model for each beta is:
beta_{i} = alpha + beta{i}_coef*y[n-1].
The first thing I tried was set alpha equal to 0, which ended up helping. However, if I did not assign super specific priors to the coefficients for each beta, the model would not converge (beta0_coef ~ n(0,0.1), beta1_coef ~ n(0,0.5), beta2_coef ~ n(0,0.5)). I am using prior knowledge as to why the sigma for beta0 is smaller than beta1 and beta2, but seeing that if I set the prior on beta0_coef to something slightly different (n(0,0.5)) makes the model go haywire makes me think there is something more that I am missing.
I have attached my code and data below.
Thank you,
David Gerth
ns-r-file.txt (360 Bytes)
ns-stan-file.txt (1.4 KB)
can-tbill.csv (1.1 KB)