aboutsummaryrefslogtreecommitdiffstats
path: root/python/notebooks
diff options
context:
space:
mode:
Diffstat (limited to 'python/notebooks')
-rw-r--r--python/notebooks/bespokes/Bespoke-MS.ipynb (renamed from python/notebooks/Bespoke-MS.ipynb)14
-rw-r--r--python/notebooks/bespokes/Bozeman.ipynb144
-rw-r--r--python/notebooks/bespokes/Venice.ipynb (renamed from python/notebooks/Venice.ipynb)35
3 files changed, 189 insertions, 4 deletions
diff --git a/python/notebooks/Bespoke-MS.ipynb b/python/notebooks/bespokes/Bespoke-MS.ipynb
index 95e4e3fb..04cade25 100644
--- a/python/notebooks/Bespoke-MS.ipynb
+++ b/python/notebooks/bespokes/Bespoke-MS.ipynb
@@ -110,7 +110,19 @@
"execution_count": null,
"metadata": {},
"outputs": [],
- "source": []
+ "source": [
+ "from pyisda.curve import Senior, Subordinated, MM14\n",
+ "bs2._index[('BACR', Senior, MM14)].inspect()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bs2._index[('BACR', Subordinated, MM14)].inspect()"
+ ]
}
],
"metadata": {
diff --git a/python/notebooks/bespokes/Bozeman.ipynb b/python/notebooks/bespokes/Bozeman.ipynb
new file mode 100644
index 00000000..5183a338
--- /dev/null
+++ b/python/notebooks/bespokes/Bozeman.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": [
+ "bozeman = DualCorrTranche.from_tradeid(1037)\n",
+ "bozeman"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bozeman.value_date=datetime.date(2019, 3, 5)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bozeman"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bozeman.pv"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bs1._index.spread()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bs1.spread"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bs1.duration"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bs1"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "jtd = bs3.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.2"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/python/notebooks/Venice.ipynb b/python/notebooks/bespokes/Venice.ipynb
index fd69edd9..fc15082d 100644
--- a/python/notebooks/Venice.ipynb
+++ b/python/notebooks/bespokes/Venice.ipynb
@@ -6,7 +6,8 @@
"metadata": {},
"outputs": [],
"source": [
- "from analytics.tranche_basket import DualCorrTranche, TrancheBasket"
+ "from analytics.tranche_basket import DualCorrTranche, TrancheBasket\n",
+ "import datetime"
]
},
{
@@ -15,7 +16,7 @@
"metadata": {},
"outputs": [],
"source": [
- "ig29 = TrancheBasket(\"IG\", 29, \"5yr\")\n",
+ "ig29 = TrancheBasket(\"IG\", 29, \"5yr\", value_date=datetime.date(2019, 3, 5))\n",
"ig29.tweak()\n",
"ig29.build_skew()"
]
@@ -26,7 +27,8 @@
"metadata": {},
"outputs": [],
"source": [
- "bs3 = DualCorrTranche(\"BS\", 3, \"2yr\", attach=5, detach=7, corr_attach=0.4, corr_detach=0.42, tranche_running=100)"
+ "bs3 = DualCorrTranche(\"BS\", 3, \"2yr\", attach=5, detach=7, corr_attach=0.4, corr_detach=0.42, tranche_running=100,\n",
+ " value_date=datetime.date(2019, 3, 5))"
]
},
{
@@ -54,6 +56,15 @@
"metadata": {},
"outputs": [],
"source": [
+ "bs3._index.spread()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
"bs3.spread"
]
},
@@ -63,6 +74,24 @@
"metadata": {},
"outputs": [],
"source": [
+ "bs3.duration"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bs3"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
"jtd = bs3.jump_to_default(ig29.skew)"
]
},