Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative values of tau #13

Open
jakubrojcek opened this issue May 3, 2022 · 3 comments
Open

Negative values of tau #13

jakubrojcek opened this issue May 3, 2022 · 3 comments

Comments

@jakubrojcek
Copy link

jakubrojcek commented May 3, 2022

  • Nelson-Siegel-Svensson Model version:
  • Python version: 3.8
  • Operating System: Windows

Description

Tau gets negative in optimization-> produces massive values for factors, least squares can't handle
maturities=np.array([ 0.25 0.5 1. 2. 3. 5. 10. 30. ])
yields = np.array([ 7.80846154, 8.16153846, 8.54207692, 9.44315385, 9.78792308,
10.31846154, 10.77930769, 10.92284615])

I recommend supplying bounds in calibrate_ns_ols:
opt_res = minimize(errorfn_ns_ols, x0=tau0, args=(t, y), bounds=((0.01,None),))

@hsuankou
Copy link

I had similar issues with nss (SVD did not converge in Linear Least Squares) but tried adding bounds (there should be two bounds for NSS) and it works now! Thanks a lot for this!

@DDAAVVEE888
Copy link

Hi, i have the same problem "SVD did not converge in Linear Least Squares".
I'm new in python, where do you set bounds for NSS?

@DDAAVVEE888
Copy link

I solved, many thanks for the bounds recommendation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants