changed risk free rate
Browse files- app.py +1 -1
- app.py.bak +2 -2
app.py
CHANGED
@@ -65,7 +65,7 @@ def output_results(start_date, end_date, tickers_string):
|
|
65 |
|
66 |
# Get optimized weights
|
67 |
ef = EfficientFrontier(mu, S)
|
68 |
-
ef.max_sharpe(risk_free_rate=0.
|
69 |
weights = ef.clean_weights()
|
70 |
expected_annual_return, annual_volatility, sharpe_ratio = ef.portfolio_performance()
|
71 |
|
|
|
65 |
|
66 |
# Get optimized weights
|
67 |
ef = EfficientFrontier(mu, S)
|
68 |
+
ef.max_sharpe(risk_free_rate=0.04)
|
69 |
weights = ef.clean_weights()
|
70 |
expected_annual_return, annual_volatility, sharpe_ratio = ef.portfolio_performance()
|
71 |
|
app.py.bak
CHANGED
@@ -29,7 +29,7 @@ def plot_efficient_frontier_and_max_sharpe(mu, S):
|
|
29 |
ef_max_sharpe.max_sharpe(risk_free_rate=0.02)
|
30 |
ret_tangent, std_tangent, _ = ef_max_sharpe.portfolio_performance()
|
31 |
ax.scatter(std_tangent, ret_tangent, marker="*", s=100, c="r", label="Max Sharpe")
|
32 |
-
# Generate random portfolios
|
33 |
n_samples = 1000
|
34 |
w = np.random.dirichlet(np.ones(ef.n_assets), n_samples)
|
35 |
rets = w.dot(ef.expected_returns)
|
@@ -104,7 +104,7 @@ with gr.Blocks() as app:
|
|
104 |
btn = gr.Button("Get Optimized Portfolio")
|
105 |
|
106 |
with gr.Row():
|
107 |
-
gr.
|
108 |
|
109 |
with gr.Row():
|
110 |
expected_annual_return = gr.Text(label="Expected Annual Return")
|
|
|
29 |
ef_max_sharpe.max_sharpe(risk_free_rate=0.02)
|
30 |
ret_tangent, std_tangent, _ = ef_max_sharpe.portfolio_performance()
|
31 |
ax.scatter(std_tangent, ret_tangent, marker="*", s=100, c="r", label="Max Sharpe")
|
32 |
+
# Generate random portfolios with random weights
|
33 |
n_samples = 1000
|
34 |
w = np.random.dirichlet(np.ones(ef.n_assets), n_samples)
|
35 |
rets = w.dot(ef.expected_returns)
|
|
|
104 |
btn = gr.Button("Get Optimized Portfolio")
|
105 |
|
106 |
with gr.Row():
|
107 |
+
gr.HTML("<h3>Optimizied Portfolio Metrics</h3>")
|
108 |
|
109 |
with gr.Row():
|
110 |
expected_annual_return = gr.Text(label="Expected Annual Return")
|