Alternatieve risicomaten

Introductie tot portefeuille-analyse in Python

Charlotte Werger

Data Scientist

Kijken naar downside-risico

Grafiek van upside- en downside-risico

  • Een goede risicomaat focust op potentiële verliezen, dus downside-risico
Introductie tot portefeuille-analyse in Python

Sortino-ratio

$$

  • Lijkt op de Sharpe-ratio, maar met een andere standaarddeviatie
  • $ Sortino \; Ratio = \frac{R_p - R_f}{\sigma_d}$
  • $\sigma_d$ is de standaarddeviatie van de downside.

$$

Berekening van downside-risico

Introductie tot portefeuille-analyse in Python

Sortino-ratio in Python

# Define risk free rate and target return of 0
rfr = 0
target_return = 0
# Calcualte the daily returns from price data
apple_returns=pd.DataFrame(apple_price.pct_change())
# Select the negative returns only 
negative_returns = apple_returns.loc[apple_returns['AAPL'] < target]
Introductie tot portefeuille-analyse in Python
# Calculate expected return and std dev of downside returns
expected_return = apple_returns['AAPL'].mean()
down_stdev = negative_returns.std()
# Calculate the sortino ratio
sortino_ratio = (expected_return - rfr)/down_stdev
print(sortino_ratio)
0.07887683763760528
Introductie tot portefeuille-analyse in Python

Maximale drawdown

  • Grootste procentuele daling van piek naar dal
  • Afhankelijk van het gekozen tijdvenster
  • Hersteltijd: tijd tot weer break-even

Draw-downs of the S&P500 over time

Introductie tot portefeuille-analyse in Python

Maximale dagelijkse drawdown in Python

# Calculate the maximum value of returns using rolling().max()
roll_max = apple_price.rolling(min_periods=1,window=250).max()

# Calculate daily draw-down from rolling max daily_drawdown = apple_price/roll_max - 1.0
# Calculate maximum daily draw-down max_daily_drawdown = daily_drawdown.rolling(min_periods=1,window=250).min()
# Plot the results daily_drawdown.plot() max_daily_drawdown.plot() plt.show()
Introductie tot portefeuille-analyse in Python

Maximale drawdown van Apple

Plot van maximale drawdown van Apple-koersen

Introductie tot portefeuille-analyse in Python

Laten we oefenen!

Introductie tot portefeuille-analyse in Python

Preparing Video For Download...