Closed shyen1998 closed 2 years ago
@shyen1998
Cheers for the feature request – it's very reasonable.
In the meantime, you can make a plot by looping over target returns and creating EfficientSemivariance portfolios (using efficient_return
). For each portfolio, save the standard deviation and expected return into e.g a list, then you can plot these.
Thanks for the tips!
Hey Martin, I tried your suggestion, but the efficient_return method only returns the weight of the portfolio (ordered dict type). May I know how would you calculate the standard deviation and expected return in this case?
@shyen1998
In each iteration, you can do call exp_return, std, shape = ef.portfolio_performance()
after running ef.efficient_return()
.
@robertmartin8 Using for loop to go through the 10 target returns (0, 0.01, 0.02, ..., 0.10), the scatter plot doesn't resemble the usual efficient frontier. And for some reason, the scatter plot changes every time I rerun the for loop.
@shyen1998
Can you try instantiating the class within the loop, e.g:
for i in range(...):
es = EfficientSemivariance(...)
...
Closing because stale – feel free to reopen if needed.
In any case, I'll hopefully be pushing some improvements to the plotting functionality so with any luck this problem will be solved
Is your feature request related to a problem? Comparing Efficient Frontiers of Mean-Variance Model and Mean-Semivariance Model
Describe the feature you'd like Plot the Efficient Frontier of Mean-Semivariance Model to compare with the Efficient Frontier of Mean-Variance Model.
Additional context Currently the plotting function only supports the EfficientFrontier and CLA objects.