diff options
Diffstat (limited to 'python/exploration')
| -rw-r--r-- | python/exploration/marketing.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/python/exploration/marketing.py b/python/exploration/marketing.py index a3f5f3b2..21411d93 100644 --- a/python/exploration/marketing.py +++ b/python/exploration/marketing.py @@ -8,8 +8,9 @@ gridsize = 500 def run_scenario(pool_size, rho, successprob, issuerweights, amount): #settings and running Z, w = GHquad(gridsize) - S, _ = BCloss_recov_dist(successprob, issuerweights, amount, rho, Z, w, Ngrid=gridsize+1, defaultflag=False) - raised = np.arange(0, pool_size+pool_size/gridsize, step=pool_size/gridsize) + S, _ = BCloss_recov_dist(successprob, issuerweights, amount, + rho, Z, w, Ngrid=gridsize+1, defaultflag=False) + raised = np.linspace(0, pool_size, gridsize+1) df = pd.DataFrame(S.flatten(), columns=['Probability'], index=raised) return df @@ -33,8 +34,12 @@ def plot_scenarios(df, bins = [0,0.1, 50, 100, 150, 200, 250, 300, 350, 400, 450 plt.pyplot.tight_layout() return ax -def prob_over(df, amount): - return df[amount:].sum() +def stats(df): + output = {} + output['Expected Raised'] = (df.index.values * df.Probability).sum() + output['Probability over 50mm'] = df[50:].sum().iloc[0] + output['Raising No Capital'] = df.iloc[0][0] + return output def plot_prob_over(df): ax = (1-df.cumsum()).plot() |
