Closed moneygeek closed 4 years ago
@moneygeek some of the allocations in the output are negative, after some research I found some sources saying that a negative value in a set of allocations indicates shorting that asset, is that correct? The allocations all sum to 1.0, just not sure if they should all be positive.
What are the inputs that you're feeding in?
mu
and cov
which I'm getting with
mu = mean_historical_return(prices_df).values
cov = sample_cov(prices_df).values
Which is how we're getting them in the test for the MarkowitzOptimizer
Right, so that can lead to negative mu, which can lead to negative allocations. Let's allow negative allocations.
Make it a child of the
Optimizer
class.The code for the NCO optimizer is found in section 4.3 of https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3469961
Please clean up and refactor the code.