Created
October 25, 2021 02:47
-
-
Save alecloudenback/2926034839b2438e2ddb54362d38d261 to your computer and use it in GitHub Desktop.
Yields.jl Smith-Wilson Grading example (Solvency II)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Yields, Plots | |
yields = [0.02,0.023,0.026,0.029,0.035] | |
maturities = [1,2,3,7,15] | |
price = [1,1,1,1,1] | |
payments = 1 | |
observable_prices = Yields.BulletBondQuotes(yields,maturities,price,payments) | |
grading_speed = 0.01:0.01:0.25 | |
ultimate_forward = 0.02 | |
curves = [Yields.SmithWilson(observable_prices,ufr=ultimate_forward,α=g) for g in grading_speed ] | |
times = 0.5:0.5:30 | |
zeros = [zero(curve,time) for time in times, curve in curves ] | |
plot(times, | |
rate.(zeros), | |
label="", | |
ylabel = "zero rate", | |
xlabel="time", | |
palette=palette(:dense,length(grading_speed)), | |
grid=false, | |
title="Solvency II Yield Curves \nwith different grading speeds \n (dummy data)" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment