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

Add CairnsPritchard #128

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft

Add CairnsPritchard #128

wants to merge 7 commits into from

Conversation

alecloudenback
Copy link
Member

@alecloudenback alecloudenback commented Jun 26, 2022

Closes #127

To-do:

  • Docs/ Docstrings
  • Tests
  • Review why version without c given tends to result in all c parameters being the same value

@codecov
Copy link

codecov bot commented Jun 26, 2022

Codecov Report

Merging #128 (d7ddeed) into master (87e04ef) will decrease coverage by 11.40%.
The diff coverage is 0.00%.

❗ Current head d7ddeed differs from pull request most recent head b16cb19. Consider uploading reports for the commit b16cb19 to get more accurate results

@@             Coverage Diff             @@
##           master     #128       +/-   ##
===========================================
- Coverage   88.58%   77.17%   -11.41%     
===========================================
  Files           9       10        +1     
  Lines         543      574       +31     
===========================================
- Hits          481      443       -38     
- Misses         62      131       +69     
Impacted Files Coverage Δ
src/CairnsPritchard.jl 0.00% <0.00%> (ø)
src/NelsonSiegelSvensson.jl 40.00% <0.00%> (-38.67%) ⬇️
src/utils.jl 83.78% <0.00%> (-7.21%) ⬇️
src/Rate.jl 98.94% <0.00%> (-0.02%) ⬇️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@alecloudenback
Copy link
Member Author

Par is having a hard time because the parameter region is too large and causing pretty wild par mechanics - how to restrict the parameter domain?

@alecloudenback
Copy link
Member Author

Here's a test case:

@testset "CairnsPritchard" begin 
    # used WebPlotDigitizer to sample points from the curve in this PDF
    # http://web.math.ku.dk/~rolf/Cairns.PDF
    target = [4.106762688183153, 4.264064261935675, 4.403887883049028, 4.550725327846389, 4.739607977033906, 4.925342222661497, 5.017616324256814, 5.01874845567391, 5.009529671277556, 4.990299610492881, 4.85329014461631, 4.732249122822781, 4.625801814105818] ./100
    mats = [0.4511004586929275, 0.850176783219295, 1.2049112939094009, 1.6052006163826604, 2.2324553324737497, 3.277385674943506, 5.2141390634757325, 6.605043375908062, 8.136251117530515, 10.225033582072788, 17.61340407657162, 23.191577301663614, 29.55631230653806]

    # reference rates from https://www.bankofengland.co.uk/statistics/yield-curves

    gilt = [4.38,4.83,5.09,5.21,5.26,5.26,5.24,5.20,5.16,5.11,5.07,5.03,4.98,4.95,4.91,4.88,4.86,4.83,4.82,4.80,4.79,4.78,4.77,4.75,4.74,4.73,4.72,4.70,4.69,4.67,4.66,4.64,4.62,4.61,4.59,4.56,4.54,4.52,4.50,4.47,4.45,4.42,4.40,4.37,4.34,4.31,4.28,4.26,4.23,4.20] ./100
    gmats = 0.5:0.5:25

    
end

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

Successfully merging this pull request may close these issues.

Add Cairns-Pritchard curve fitting?
1 participant