JuliaActuary / FinanceModels.jl

Composable contracts, models, and functions that allow for modeling of both simple and complex financial instruments
https://juliaactuary.github.io/FinanceModels.jl/dev
MIT License
36 stars 10 forks source link

Split SmithWilson into a base curve and a correction #64

Open kasperrisager opened 2 years ago

kasperrisager commented 2 years ago

I'm looking at the downstream use of SmithWilson, more specifically the calibration of alpha which is also governed by Solvency II. It strikes me that a SmithWilson discount factor could be reinterpreted more generally as the product of a base yield curve (presently == Constant(Rate(ufr, Continuous()) and a correction term independent of ufr.

The Solvency II calibration of alpha is equivalent to searching for an alpha where the continuous 'forward rate' of the correction (at a given maturity) is some small value, so it would be pretty neat to have the correction separated.

I'll probably go make a pr for this in the near future, but maintainers are now warned 😃, and early thoughts are welcome.

alecloudenback commented 2 years ago

That does sound interesting and potentially useful? A link I shared on the original PR decomposed the curve into components, is this getting at the same thing?

Also, did you see this question on LinkedIn?

kasperrisager commented 2 years ago

As I read it, the linked article does something slightly different, pulling out an additive term exp(-ufr * t). But you can go further and pull it out as a factor in the discount function, and the remaining factor will be independent of ufr.

Thanks for pointing out the Linked In post. I think she misinterpreted JuliaActuary as a personal project of mine. I worked as a freelance consultant a few years back, and something like this could have been a product on my shelf, so she's excused 🙂.

alecloudenback commented 2 years ago

Do you envision that this change woudl affect the API or would be an internal change? (ie should I add to v1 milestone?)

kasperrisager commented 2 years ago

There would be some change to the API (or maybe just an extension, it might be possible to do it in a non-breaking way). Adding as a milestone item would be nice, but I don't think it's important enough to hold back v1.

I may have to think about it a bit more, and that might finishing up a pr, so maybe the problem will solve itself...