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)
from empyrial import empyrial, Engine
portfolio = Engine(
start_date= "2020-06-09",
benchmark = ["SPY"], #SPY is set by default
portfolio= ["BABA", "AAPL", "KO", "^DJI","^IXIC"],
optimizer = "MEANVAR", # defines Mean-Variance as the optimizer
max_vol = 0.25, #maximize the return for this level of volatility (25%)
⚠️ If the max_vol value is too low or if the assets in portfolio are too volatile, it might give you an error.