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

Buffered CurveMap #17

Closed
lucasprocessi opened this issue Dec 6, 2021 · 0 comments
Closed

Buffered CurveMap #17

lucasprocessi opened this issue Dec 6, 2021 · 0 comments
Labels

Comments

@lucasprocessi
Copy link
Collaborator

Hi,
it seems that whenever I try to buffer a CurveMap, I always get the original non-mapped zero rates.

For instance, in those tests bellow:

@testset "Buffered CurveMap" begin
    
    flat_curve = InterestRates.IRCurve(
        "flat", InterestRates.Actual360(), InterestRates.SimpleCompounding(), InterestRates.StepFunction(),
        Date(2021,1,1), [1], [0.1]
    )
    @test InterestRates.zero_rate(flat_curve, Date(2022,1,1))  0.1

    map_curve = InterestRates.CurveMap("mapped", (r,m) -> r+0.05, flat_curve)
    @test InterestRates.zero_rate(map_curve, Date(2022,1,1))  0.15

    buffered_curve = InterestRates.BufferedIRCurve(map_curve)
    @test InterestRates.zero_rate(buffered_curve, Date(2022,1,1))  0.15

end

... last test fails.

Buffered CurveMap: Test Failed at /home/InterestRates/test/runtests.jl:646
  Expression: InterestRates.zero_rate(buffered_curve, Date(2022, 1, 1)) ≈ 0.15
   Evaluated: 0.1 ≈ 0.15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants