diff options
Diffstat (limited to 'python/notebooks/bespokes')
| -rw-r--r-- | python/notebooks/bespokes/Palma.ipynb | 144 |
1 files changed, 144 insertions, 0 deletions
diff --git a/python/notebooks/bespokes/Palma.ipynb b/python/notebooks/bespokes/Palma.ipynb new file mode 100644 index 00000000..9cef74d9 --- /dev/null +++ b/python/notebooks/bespokes/Palma.ipynb @@ -0,0 +1,144 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from analytics.tranche_basket import DualCorrTranche, TrancheBasket\n", + "import datetime" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ig29 = TrancheBasket(\"IG\", 29, \"5yr\")\n", + "ig29.tweak()\n", + "ig29.build_skew()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "palma = DualCorrTranche(\"BS\", 5, \"2yr\",attach=7, detach=15, corr_attach=None, corr_detach=None, tranche_running=100)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "palma.value_date=datetime.date(2019, 4, 18)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "palma.mark(skew=ig29.skew)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "palma" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "palma.spread" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "palma.duration" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "palma._index.spread()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from pyisda.curve import Senior, MM14\n", + "palma._index[(\"CMACGM\", Senior, MM14)].to_series()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "jtd = palma.jump_to_default(ig29.skew)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "jtd.sort_values()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} |
