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

Interpolation issue with Hagan West Monotone Convex #64

Closed
bigfatwhale opened this issue Dec 30, 2021 · 3 comments
Closed

Interpolation issue with Hagan West Monotone Convex #64

bigfatwhale opened this issue Dec 30, 2021 · 3 comments
Assignees

Comments

@bigfatwhale
Copy link

bigfatwhale commented Dec 30, 2021

The following input seems to give bad output with a strange jump,

reference_times = np.array([0.08219178, 0.12328767, 0.16438356, 0.24657534, 0.32876712, 0.4109589, 0.49315068, 0.98630137, 1.02191781], dtype=np.float64)
yields = np.array([2.5e-5, 1.189e-4, 2.151e-4, 4.236e-4, 6.5e-4, 8.905e-4, 1.141e-3, 2.6321e-3, 4.366e-3], dtype=np.float64)
interp_times = np.linspace(0.1, 1.0, 100, dtype=np.float64)
interp_yields = monotone_convex.interpolate_yields(interp_times, reference_times, yields=yields)

Plotting it out gives,

image

Can someone kindly advise?

Regards,

copybara-service bot pushed a commit that referenced this issue Jan 4, 2022
@cyrilchim
Copy link
Contributor

Hi, thank you for reporting the issue!

There was a bug in the code which is fixed in the latest commit

Using the nightly version (pip install tff-nightly), I run your code and get

Screen Shot 2022-01-05 at 10 03 21 AM

Please let me know if this solves the issue

@bigfatwhale
Copy link
Author

Many thanks for the prompt turnaround! Let me try it out and report back :)

Cheers,

@bigfatwhale
Copy link
Author

I've tested and the fix looks good!

Thanks

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

2 participants