New package for shifting of market data

Hi,

for sensitivity calculation, stress testing or market risk (VaR, etc.) calculation market data items (like interest rate and FX curves) need to be shifted.
Often the base items and the shift sizes are not defined on the same maturity grid, thus interpolation is required.

This small package aims at making “calculations” with market data items easier by taking care about interpolations. E.g. when “adding” two curves containing the base interest rates and (maturity dependent) shift sizes, they are interpolated to a common grid before adding.

A Curve in this package is essentially a collection of points (x, y) , together with an interpolation and extrapolation method.
Curve objects have a number of standard calculation function defined (like addition, multiplication, logarithm), thus they can be used in algebraic expressions analogue to scalars.

This is my first Julia package, I hope that this will be helpful for you.
Suggestions, Issues, etc. are welcome!

7 Likes

Looks cleanly coded :slight_smile: Consider using inline or block comments for others reading your code. For example, clarify { etp, etpm, itpm, Titp} and any clear algorithmic choices you may have made.

Thanks for your suggestions!
I’ll add more docstrings and reasonings about my choices.

I improved the docstrings, added reasonings / explanations and a few more tests (especially for non-standard interpolation / extrapolation methods taken from Interpolations.jl). Hope that makes my choices more transparent.

Thanks again for your valuable feedback!

1 Like

night and day – good work

It would help to add an example of plotting a Curve (or two and their interpolation) to the README.md.

Welcome aboard!

Hi,

the Curves package is now registered and contains a bunch of new functionality.

Please let me know if you encounter any issues or are missing anything!