Mean-Variance
Mean-variance analysis is the process of weighing the risk, expressed as variance, against expected return. Investors weigh how much risk they are willing to take on in exchange for different levels of reward. The mean-variance analysis allows investors to find the biggest reward at a given level of risk. (Source: Investopedia)
1
from empyrial import empyrial, Engine
2
​
3
portfolio = Engine(
4
start_date= "2020-06-09",
5
benchmark = ["SPY"], #SPY is set by default
6
portfolio= ["BABA", "AAPL", "KO", "^DJI","^IXIC"],
7
optimizer = "MEANVAR", # defines Mean-Variance as the optimizer
8
max_vol = 0.25, #maximize the return for this level of volatility (25%)
9
)
10
​
11
empyrial(portfolio)
Copied!
⚠️ If the max_vol value is too low or if the assets in portfolio are too volatile, it might give you an error.
Last modified 2mo ago
Copy link