Lirsen Myrtaj
commited on
Commit
•
2654178
1
Parent(s):
fc2982e
Update app.py
Browse files
app.py
CHANGED
@@ -22,6 +22,16 @@ from sharp_ratio import(
|
|
22 |
preprocess,
|
23 |
sharp_ratio_func
|
24 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
def load_heading():
|
26 |
"""The function that displays the heading.
|
27 |
Provides instructions to the user
|
@@ -142,16 +152,33 @@ return is calculated. The model results can be found in Appendix A.
|
|
142 |
##### EDIT HERE ##### koi
|
143 |
st.header('CAPM Model and the Efficient Frontier')
|
144 |
"""
|
145 |
-
CAPM model measures systematic risks, however many of it's functions
|
146 |
of the risks vs. returns relationship. It is better to use CAPM model in conjunction with the Efficient Frontier to better
|
147 |
graphically depict volatility (a measure of investment risk) for the defined rate of return. \n
|
148 |
Below we map the linear Utility function from the CAPM economic model along with the Efficient Frontier
|
149 |
-
Each circle depicted above is a variation of the portfolio with the same input
|
150 |
-
Portfolios with higher volatilities
|
151 |
As you input different porfolio assets, take note of how diversification can improve a portfolio's risk versus reward profile.
|
152 |
"""
|
153 |
ef_viz(choices['data'],choices['choices'])
|
154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
basic_portfolio(choices['combined_df'])
|
156 |
display_heat_map(choices['data'],choices['choices'])
|
157 |
#display_portfolio_return(choices['combined_df'], choices['choices'])
|
|
|
22 |
preprocess,
|
23 |
sharp_ratio_func
|
24 |
)
|
25 |
+
|
26 |
+
def risk_str(num):
|
27 |
+
if num >=5 and num <15:
|
28 |
+
return 'Low Risk Aversion'
|
29 |
+
elif num >= 15 and num <25:
|
30 |
+
return 'Medium Risk Aversion'
|
31 |
+
elif num >= 25 and num <=35:
|
32 |
+
return 'High Rish Aversion'
|
33 |
+
#### Koi
|
34 |
+
|
35 |
def load_heading():
|
36 |
"""The function that displays the heading.
|
37 |
Provides instructions to the user
|
|
|
152 |
##### EDIT HERE ##### koi
|
153 |
st.header('CAPM Model and the Efficient Frontier')
|
154 |
"""
|
155 |
+
CAPM model measures systematic risks, however many of it's functions have unrealistic assumptions and rely heavily on a linear interpretation
|
156 |
of the risks vs. returns relationship. It is better to use CAPM model in conjunction with the Efficient Frontier to better
|
157 |
graphically depict volatility (a measure of investment risk) for the defined rate of return. \n
|
158 |
Below we map the linear Utility function from the CAPM economic model along with the Efficient Frontier
|
159 |
+
Each circle depicted above is a variation of the portfolio with the same input asset, only different weights.
|
160 |
+
Portfolios with higher volatilities have a yellower shade of hue, while portfolios with a higher return have a larger radius. \n
|
161 |
As you input different porfolio assets, take note of how diversification can improve a portfolio's risk versus reward profile.
|
162 |
"""
|
163 |
ef_viz(choices['data'],choices['choices'])
|
164 |
+
"""
|
165 |
+
There are in fact two components of the Efficient Frontier: the Efficient Frontier curve itself and the Minimum Variance Frontier.
|
166 |
+
The lower curve, which is also the Minimum Variance Frontier will contain assets in the portfolio
|
167 |
+
that has the lowest volatility. If our portfolio contains "safer" assets such as Governmental Bonds, the further to the right
|
168 |
+
of the lower curve we will see a portfolio that contains only these "safe" assets, the portfolios on
|
169 |
+
this curve, in theory, will have diminishing returns.\n
|
170 |
+
The upper curve, which is also the Efficient Frontier, contains portfolios that have marginally increasing returns as the risks
|
171 |
+
increases. In theory, we want to pick a portfolio on this curve, as these portfolios contain more balanced weights of assets
|
172 |
+
with acceptable trade-offs between risks and returns. \n
|
173 |
+
If an investor is more comfortable with investment risks, they can pick a portfolio on the right side of the Efficient Frontier.
|
174 |
+
Whereas, a conservative investor might want to pick a portfolio from the left side of the Efficient Frontier. \n
|
175 |
+
Take notes of the assets' Betas and how that changes the shape of the curve as well. \n
|
176 |
+
How does the shape of the curve change when
|
177 |
+
the assets are of similar Beta vs when they are all different?\n
|
178 |
+
Note the behavior of the curve when the portfolio contains only assets with Betas higher than 1 vs. when Betas are lower than 1.\n
|
179 |
+
|
180 |
+
"""
|
181 |
+
##### ##### Koi
|
182 |
basic_portfolio(choices['combined_df'])
|
183 |
display_heat_map(choices['data'],choices['choices'])
|
184 |
#display_portfolio_return(choices['combined_df'], choices['choices'])
|