The analytical solution of efficient frontier.
Analysis on the modern portfolio theory.
instance = EfficientFrontier(
symbols=["AAPL", "XOM", "PFE", "F", "WMT", "BA", "TSLA", "AMD"],
start_date="20200101",
end_date="20210130",
simulation_times=5000,
solve_granularity=1000,
analytical_solution=True,
use_optimizer=True,
tangency_line=True,
)
instance.plot((12,8))
(2021/1/30 Update) optimizerSolver()
to solve for the efficient frontier using scipy optimizer. Added the constraint of no short. Due to the limit of the optimizer, this solution performs bad for low mu
part.
(2021/2/1 Update) tangencySolver()
which solves for the “with risk-free asset” case. The solution can be proved to be the tangency line of the efficient frontier curve in the “no risk-free asset” setting.
Plotting the figure of all above.
See http://yaohuacn.com/2021/02/02/Modern-Portfolio-Theory-Mean-variance-analysis-Efficient-Frontier/