show list of withdrawl rates and success rates
Browse files
app.py
CHANGED
|
@@ -233,6 +233,10 @@ def run_simulation(
|
|
| 233 |
results_text += f"The lowest tested SWR ({lowest_tested_swr*100:.1f}%) had a success rate of {highest_success_at_lowest_swr*100:.2f}%.\n"
|
| 234 |
results_text += "Consider revising assumptions (e.g., higher returns, lower volatility/inflation, shorter horizon) or target success rate.\n"
|
| 235 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 236 |
# --- Plotting Results ---
|
| 237 |
swrs_plot = [r['swr'] * 100 for r in all_results]
|
| 238 |
success_rates_plot = [r['success_rate'] * 100 for r in all_results]
|
|
@@ -402,7 +406,7 @@ with gr.Blocks() as demo:
|
|
| 402 |
status_output = gr.Textbox(label="Status", interactive=False, lines=1)
|
| 403 |
|
| 404 |
gr.Markdown("#### Calculated Safe Withdrawal Rate Summary")
|
| 405 |
-
results_output = gr.Textbox(label="Summary Text", lines=5
|
| 406 |
|
| 407 |
gr.Markdown("#### SWR Success Rates Plot")
|
| 408 |
swr_plot_output = gr.Plot(label="SWR Success Rates")
|
|
|
|
| 233 |
results_text += f"The lowest tested SWR ({lowest_tested_swr*100:.1f}%) had a success rate of {highest_success_at_lowest_swr*100:.2f}%.\n"
|
| 234 |
results_text += "Consider revising assumptions (e.g., higher returns, lower volatility/inflation, shorter horizon) or target success rate.\n"
|
| 235 |
|
| 236 |
+
results_text += "\n--- All Tested Withdrawal Rates and Success Probabilities ---\n"
|
| 237 |
+
for r in all_results:
|
| 238 |
+
results_text += f"SWR: {r['swr']*100:.2f}% -> Success Rate: {r['success_rate']*100:.2f}%\n"
|
| 239 |
+
|
| 240 |
# --- Plotting Results ---
|
| 241 |
swrs_plot = [r['swr'] * 100 for r in all_results]
|
| 242 |
success_rates_plot = [r['success_rate'] * 100 for r in all_results]
|
|
|
|
| 406 |
status_output = gr.Textbox(label="Status", interactive=False, lines=1)
|
| 407 |
|
| 408 |
gr.Markdown("#### Calculated Safe Withdrawal Rate Summary")
|
| 409 |
+
results_output = gr.Textbox(label="Summary Text", interactive=False) # Removed lines=5 to allow auto-scrolling
|
| 410 |
|
| 411 |
gr.Markdown("#### SWR Success Rates Plot")
|
| 412 |
swr_plot_output = gr.Plot(label="SWR Success Rates")
|