{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import exploration.marketing as mk\n", "import numpy as np\n", "import pandas as pd\n", "import matplotlib as plt" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#Vary weights:size of investment and success_prob: likelihood of investment" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "##----Now look at the consequence of the different approaches -----##\n", "#100 prospect of 10mm each, correlation of 30%, likelihood: 10% each- expected capital raised: 100mm\n", "num_prospect = 100\n", "pool_size = 1000 #1bn\n", "rho = .3\n", "prob = .1\n", "successprob = np.full((num_prospect, 1), prob)\n", "issuerweights = np.full(num_prospect, 1/num_prospect)\n", "zero_recov = np.full(num_prospect, 0.0)\n", "bins = [0,0.1, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, pool_size]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "df = mk.run_scenario(pool_size, rho, successprob, issuerweights, zero_recov)\n", "ax = mk.plot_prob_over(df)\n", "mk.plot_scenarios(df, bins)\n", "mk.stats(df)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#40 prospect of 50mm each, correlation of 80%, likelihood: 5% each - expected capital raised: 100mm\n", "num_prospect = 40\n", "pool_size = 2000\n", "rho = .6 \n", "prob = .05\n", "successprob = np.full((num_prospect, 1), prob)\n", "issuerweights = np.full(num_prospect, 1/num_prospect)\n", "zero_recov = np.full(num_prospect, 0.0)\n", "bins = [0,0.1, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, pool_size]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "df = mk.run_scenario(pool_size, rho, successprob, issuerweights, zero_recov)\n", "mk.plot_prob_over(df)\n", "mk.plot_scenarios(df, bins)\n", "mk.stats(df)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#Current pipeline\n", "#\tLikelihood\t\t\t\n", "#size\t1\t2\t3\t4\n", "#25\t0\t1\t1\t6\n", "#10\t0\t0\t1\t12\n", "#5\t4\t0\t2\t19\n", "#2\t2\t0\t0\t16\n", "#35% correlation\n", "num = (4, 2, 1, 1, 1, 2, 6, 12, 19, 16)\n", "size = (5, 2, 25, 25, 10, 5, 25, 10, 5, 2)\n", "prob = (.5, .5, .35, .25, .25, .25, .05, .05, .05, .05)\n", "rho = .25\n", "zero_recov = np.full(sum(num), 0.0)\n", "pool_size = sum(n*s for n,s in zip(num, size))\n", "successprob, issuerweights = [], []\n", "for n, s, p in zip(num,size,prob):\n", " successprob.append(np.full((n, 1), p)) \n", " issuerweights.append(np.full(n, s/pool_size))\n", "successprob = np.concatenate(successprob)\n", "issuerweights = np.concatenate(issuerweights)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "bins = [0,0.1, 50, 100, 150, 200, 250, 300, 350, 400, 450, pool_size]\n", "pool_size, sum(num)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "df = mk.run_scenario(pool_size, rho, successprob, issuerweights, zero_recov)\n", "mk.plot_prob_over(df)\n", "mk.plot_scenarios(df, bins)\n", "mk.stats(df)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#Current LMCG pipeline\n", "#LMCG\tLikelihood\t\t\t\n", "#size\t1\t2\t3\t4\n", "#25\t0\t0\t0\t2\n", "#10\t0\t0\t0\t2\n", "#5\t0\t0\t1\t2\n", "#2\t1\t0\t0\t1\n", "#50% correlation\n", "num = (1,1,3,2,2,1)\n", "size = (2,5,25,10,5,2)\n", "prob = (.5, .25, .05, .05, .05, .05)\n", "rho = .6\n", "zero_recov = np.full(sum(num), 0.0)\n", "pool_size = sum(n*s for n,s in zip(num, size))\n", "successprob, issuerweights = [], []\n", "for n, s, p in zip(num,size,prob):\n", " successprob.append(np.full((n, 1), p)) \n", " issuerweights.append(np.full(n, s/pool_size))\n", "successprob = np.concatenate(successprob)\n", "issuerweights = np.concatenate(issuerweights)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "bins = [0,0.1, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, pool_size]\n", "pool_size, sum(num)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "df = mk.run_scenario(pool_size, rho, successprob, issuerweights, zero_recov)\n", "mk.plot_prob_over(df)\n", "mk.plot_scenarios(df, bins)\n", "mk.stats(df)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#Current Agecroft pipeline\n", "#Agecroft\tLikelihood\t\t\t\n", "#size\t1\t2\t3\t4\n", "#25\t0\t1\t1\t3\n", "#10\t0\t0\t1\t10\n", "#5\t4\t0\t1\t17\n", "#2\t1\t0\t0\t15\n", "#30% correlation\n", "num = (4,1,1,1,1,1,3,10,17,15)\n", "size = (5,2,25,25,10,5,25,10,5,2)\n", "prob = (.5, .5,.35,.25,.25,.25,.05,.05,.05,.05)\n", "rho = .2\n", "zero_recov = np.full(sum(num), 0.0)\n", "pool_size = sum(n*s for n,s in zip(num, size))\n", "successprob, issuerweights = [], []\n", "for n, s, p in zip(num,size,prob):\n", " successprob.append(np.full((n, 1), p)) \n", " issuerweights.append(np.full(n, s/pool_size))\n", "successprob = np.concatenate(successprob)\n", "issuerweights = np.concatenate(issuerweights)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "bins = [0,0.1, 50, 100, 150, 200, 250, 300, 350, pool_size]\n", "pool_size, sum(num)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "df = mk.run_scenario(pool_size, rho, successprob, issuerweights, zero_recov)\n", "mk.plot_prob_over(df)\n", "mk.plot_scenarios(df, bins)\n", "mk.stats(df)" ] }, { "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.6.1" } }, "nbformat": 4, "nbformat_minor": 2 }