CDS pricer
No License
This file has been updated as of 12 March. I believe it is now more accurate and more flexible, but it's still not the real thing. JPMorgan's source code has been made available at www.cdsmodel.com, I have not yet compared my implementation with theirs.
This program is still based on the paper by O'Kane and Turnbull (available at http://www.nuclearphynance.com/User%20Files/256/cds.pdf ). This routine prices a CDS, taking current market spreads to bootstrap survival probabilities, which imply a "risky present value". Contract details (initial spread, end date) then give the theoretical market price of the contract. The results are very similar to Bloomberg's CDSW page in simple tests.
The function requires the Financial Toolbox to manage dates, but if you are willing to sacrifice some accuracy this can easily be worked around.
Perhaps I should state that this is an analytical tool, and I am not responsible for any investment decisions made using it.
Cite As
Rogier Swierstra (2024). CDS pricer (https://www.mathworks.com/matlabcentral/fileexchange/22014-cds-pricer), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- AI, Data Science, and Statistics > Statistics and Machine Learning Toolbox > Industrial Statistics >
- Computational Finance > Financial Toolbox > Price and Analyze Financial Instruments >
- Computational Finance > Financial Instruments Toolbox > Price Instruments Using Functions > Credit Derivatives and Credit Exposures >
- Computational Finance > Datafeed Toolbox > Financial Data > Bloomberg Desktop >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.