You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Question: Is there a way to set a minimum allocation? #2
Hi Robert... This is awesome, thanks so much for your work on this. I have two related questions:
I've found that the library is telling me to allocate 0.1% to something, and that's just not realistic for me, partly because my investment platform has a minimum purchase of $250. That's a cool quarter mil... :) I tried weight_bounds=(0.1, 1), but that didn't do what I thought it would, which makes sense now that I think about it. Is there a way to set minimum allocations?
I also tried setting gamma, but that basically told me to buy a roughly equal weight of every possible asset. That may well be optimal, but it's a pain for similar reasons. Is there a way to limit the number of assets chosen?
Apologies for the late response, I haven't properly configured notifications.
weight_bounds is meant to be able to do that. The below code should mean that no weights are below 2%.
ef = EfficientFrontier(mu, S, weight_bounds=(0.02,1))
But note that you must consider the total number of assets in your portfolio before you set the bounds. So if you are optimising 20 assets, you cannot set the lower bound to less than 1/20 = 0.05, because all weights must sum to one. Perhaps this is why you had difficulty with weight_bounds=(0.1, 1).
The point of gamma is to reduce the extreme positions (very large weights or very small weights). The higher the gamma you use, the closer the portfolio will be towards the equal weight portfolio. Try a lower gamma.
Please feel free to reach out if you have any other issues, I'll try to respond more promptly!
Activity
robertmartin8 commentedon Sep 4, 2018
Hi Matt,
Apologies for the late response, I haven't properly configured notifications.
weight_boundsis meant to be able to do that. The below code should mean that no weights are below 2%.ef = EfficientFrontier(mu, S, weight_bounds=(0.02,1))But note that you must consider the total number of assets in your portfolio before you set the bounds. So if you are optimising 20 assets, you cannot set the lower bound to less than 1/20 = 0.05, because all weights must sum to one. Perhaps this is why you had difficulty with
weight_bounds=(0.1, 1).Please feel free to reach out if you have any other issues, I'll try to respond more promptly!