enjine-com / mcos

Implementation of Monte Carlo Optimization Selection from the paper "A Robust Estimator of the Efficient Frontier"
MIT License
55 stars 18 forks source link

Create the NCO Optimizer #3

Closed moneygeek closed 4 years ago

moneygeek commented 4 years ago

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.

kastkeepitjumpinlikekangaroos commented 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.

moneygeek commented 4 years ago

What are the inputs that you're feeding in?

kastkeepitjumpinlikekangaroos commented 4 years ago

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

moneygeek commented 4 years ago

Right, so that can lead to negative mu, which can lead to negative allocations. Let's allow negative allocations.