Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
OLMAR algorithm w/ CVXOPT?

If I'm reading things correctly, the OLMAR mean reversion algorithm published in various forms on this site could be re-formulated to use the recently enabled CVXOPT module. Some references:

http://arxiv.org/ftp/arxiv/papers/1206/1206.4626.pdf
http://cvxopt.org/

In the paper by B. Li, the optimization problem is presented in Section 4.2. Rather than using the algorithm proposed by the author, it appears that the CVXOPT module could be used to update the portfolio.

Why use the CVXOPT module? My thinking is that the code will be cleaner and easier to follow. Also, there should be flexibility in modifying the constraints, without having to dig into the mathematical rigamarole.

It's on my Quantopian "to do" list to give this a try, but if someone beats me to it, please post your code.

3 responses

Grant,

I think this would make the algorithm a whole lot slower and more error prone. The reason is that the authors go through all that math mumbo jumbo to solve the optimization problem analytically. This will almost always be better than solving it numerically (i.e. with cvxopt). However, this could be interesting if you perhaps wanted to extend the model to where the optimization could not be done analytically.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Thanks Thomas,

I agree about the speed benefit of an analytic solution that does not require iteration (although the backtester feels pretty slow to begin with, so it might not make a significant difference). I'm not sure about the concern over errors, unless you are thinking that the numerical solver will sometimes not land on a global minimum?

Grant

Yeah, the numerical instability concern isn't huge since convex algorithms work pretty well in general (if the problem is provably convex) but they still can still be brittle for various other reasons.