Wprowadzenie do analizy portfela w Pythonie
Charlotte Werger
Data Scientist
$ $
Portfel 1
$ $
Portfel 2
$$
$ Sharpe \; ratio = \frac{R_p - R_f} {\sigma_p} $
Gdzie: $ R_p$ to stopa zwrotu portfela, $R_f$ to stopa wolna od ryzyka, a ${\sigma_p} $ to odchylenie standardowe portfela
Pamiętasz wzór na ${\sigma_p} $ portfela?
$$
# Calculate the annualized standard deviation
annualized_vol = apple_returns.std()*np.sqrt(250)
print (annualized_vol)
0.2286248397870068
# Define the risk free rate
risk_free = 0.01
# Calcuate the sharpe ratio
sharpe_ratio = (annualized_return - risk_free) / annualized_vol
print (sharpe_ratio)
0.6419569149994251
$ $
Portfel 1
$ $
Portfel 2
Wprowadzenie do analizy portfela w Pythonie