Update app.py
Browse files
app.py
CHANGED
@@ -82,21 +82,30 @@ css = ""
|
|
82 |
|
83 |
with gr.Blocks(css=css) as demo:
|
84 |
with gr.Column():
|
|
|
|
|
85 |
with gr.Row():
|
86 |
p_win = gr.Slider(0, 100, value=50, label='Win Prob.(%)', interactive=True)
|
87 |
with gr.Row():
|
|
|
88 |
win = gr.Number(value=50, label='Gain (%)', interactive=True)
|
89 |
loss = gr.Number(value=40, label='Loss (%)', interactive=True)
|
90 |
with gr.Row():
|
|
|
91 |
leverage = gr.Slider(0, 100, value=100, label='Leverage (%)', interactive=True)
|
92 |
with gr.Row():
|
93 |
btn = gr.Button('Go!')
|
94 |
-
with gr.Column(scale=1, min_width=
|
95 |
with gr.Row():
|
96 |
ensemble = gr.Image(label="Ensemble Perspective", shape=(300, 300), elem_id="plot_ensemble")
|
97 |
time = gr.Image(label="Time Perspective", shape=(300, 300), elem_id="plot_time")
|
98 |
richest = gr.Image(label="Richest Individual", shape=(300, 300), elem_id="plot_richest")
|
99 |
-
|
|
|
|
|
|
|
|
|
|
|
100 |
btn.click(process, [p_win, win, loss, leverage], [ensemble, time, richest])
|
101 |
|
102 |
demo.launch()
|
|
|
82 |
|
83 |
with gr.Blocks(css=css) as demo:
|
84 |
with gr.Column():
|
85 |
+
with gr.Row():
|
86 |
+
gr.Markdown('Choose the probability of a positive outcome.')
|
87 |
with gr.Row():
|
88 |
p_win = gr.Slider(0, 100, value=50, label='Win Prob.(%)', interactive=True)
|
89 |
with gr.Row():
|
90 |
+
gr.Markdown('Choose the return, in percentage, for a positive (gain) and negative (loss) outcome. For example, a 50% gain and 40% loss means a bet of $100 will either result in $150 (50% gain) or $60 (40% loss).')
|
91 |
win = gr.Number(value=50, label='Gain (%)', interactive=True)
|
92 |
loss = gr.Number(value=40, label='Loss (%)', interactive=True)
|
93 |
with gr.Row():
|
94 |
+
gr.Markdown('Choose the leverage, that is, the percentage of your total assets that you are willing to bet.')
|
95 |
leverage = gr.Slider(0, 100, value=100, label='Leverage (%)', interactive=True)
|
96 |
with gr.Row():
|
97 |
btn = gr.Button('Go!')
|
98 |
+
with gr.Column(scale=1, min_width=800):
|
99 |
with gr.Row():
|
100 |
ensemble = gr.Image(label="Ensemble Perspective", shape=(300, 300), elem_id="plot_ensemble")
|
101 |
time = gr.Image(label="Time Perspective", shape=(300, 300), elem_id="plot_time")
|
102 |
richest = gr.Image(label="Richest Individual", shape=(300, 300), elem_id="plot_richest")
|
103 |
+
with gr.Column(scale=1, min_width=800):
|
104 |
+
with gr.Row():
|
105 |
+
gr.Markdown('The ensemble perspective shows the average wealth of an individual over time (which may be heavily affected by outliers, that is, an extremely rich individual). That is the expected value of the bet assuming ergodicity (in layman terms, "do over").')
|
106 |
+
gr.Markdown('The time perspective shows the median wealth, that is, the typical wealth of an individual. It is the likely outcome for a regular individual.')
|
107 |
+
gr.Markdown('This plot shows the wealth of the richest individual of them all, the one that got the best lucky streak out of 100,000 simulated individuals.')
|
108 |
+
|
109 |
btn.click(process, [p_win, win, loss, leverage], [ensemble, time, richest])
|
110 |
|
111 |
demo.launch()
|