Maximum Sharpe กับ Minimum Volatility

การวิเคราะห์พอร์ตโฟลิโอด้วย Python

Charlotte Werger

Data Scientist

ทบทวน Efficient Frontier

$$

  • Efficient frontier: พอร์ตโฟลิโอทั้งหมดที่มีอัตราส่วนความเสี่ยงและผลตอบแทนที่ดีที่สุด
  • Maximum Sharpe portfolio: พอร์ตที่มี Sharpe ratio สูงสุดบน EF
  • Minimum volatility portfolio: พอร์ตที่มีระดับความเสี่ยงต่ำสุดบน EF

$$ กราฟของ efficient frontier

การวิเคราะห์พอร์ตโฟลิโอด้วย Python

ปรับแต่งการ optimize ใน PyPortfolioOpt

แผนภูมิตัวเลือกใน PyPortfolioOpt

การวิเคราะห์พอร์ตโฟลิโอด้วย Python

Maximum Sharpe Portfolio

Maximum Sharpe portfolio: Sharpe ratio สูงสุดบน EF

from pypfopt.efficient_frontier import EfficientFrontier
# Calculate the Efficient Frontier with mu and S
ef = EfficientFrontier(mu, Sigma)
raw_weights = ef.max_sharpe()
# Get interpretable weights 
cleaned_weights = ef.clean_weights()
{'GOOG': 0.01269,'AAPL': 0.09202,'FB': 0.19856,
 'BABA': 0.09642,'AMZN': 0.07158,'GE': 0.02456,...}
การวิเคราะห์พอร์ตโฟลิโอด้วย Python

Maximum Sharpe Portfolio

# Get performance numbers
ef.portfolio_performance(verbose=True)
Expected annual return: 33.0%
Annual volatility: 21.7%
Sharpe Ratio: 1.43
การวิเคราะห์พอร์ตโฟลิโอด้วย Python

Minimum Volatility Portfolio

Minimum volatility portfolio: ระดับความเสี่ยงต่ำสุดบน EF

# Calculate the Efficient Frontier with mu and S
ef = EfficientFrontier(mu, Sigma)
raw_weights = ef.min_volatility()
# Get interpretable weights and performance numbers
cleaned_weights = ef.clean_weights()
{'GOOG': 0.05664, 'AAPL': 0.087, 'FB': 0.1591,
'BABA': 0.09784, 'AMZN': 0.06986, 'GE': 0.0123,...}
การวิเคราะห์พอร์ตโฟลิโอด้วย Python

Minimum Volatility Portfolio

ef.portfolio_performance(verbose=True)
Expected annual return: 17.4%
Annual volatility: 13.2%
Sharpe Ratio: 1.28
การวิเคราะห์พอร์ตโฟลิโอด้วย Python

มาดู Efficient Frontier อีกครั้ง

กราฟ efficient frontier แสดง minimum volatility และ maximum Sharpe portfolio

การวิเคราะห์พอร์ตโฟลิโอด้วย Python

Maximum Sharpe กับ Minimum Volatility

กราฟ efficient frontier แสดง minimum volatility และ maximum Sharpe portfolio

การวิเคราะห์พอร์ตโฟลิโอด้วย Python

มาฝึกกันเถอะ!

การวิเคราะห์พอร์ตโฟลิโอด้วย Python

Preparing Video For Download...