Skip to content

Add Conical Optimizer to PortfolioAnalytics

Erol Biceroglu edited this page Mar 7, 2021 · 9 revisions

Background

PortfolioAnalytics provides an R package for optimization of complex multi-objective portfolios. PortfolioAnalytics supports multiple solvers so that a user can specify how to attempt to construct an optimal portfolio.

This project would look to add an a conical optimizer to PortfolioAnalytics to give the user additional options for efficient convergence of their portfolio objectives.

The benefits of a conical optimizer in portfolio management and the motivation to use CVXR as the object-oriented modeling language include the following:

  • CVXR supports a common modeling paradigm for a very wide range of optimizers, including two conic solvers (ECOS and SCS)
    • A conic solver provides a way to construct portfolios that minimize expected quadratic shortfall (EQS), called SMCR second order special case of higher order coherent risk measures in Krokhmal (2007)
  • It allows efficient solutions for large (1000+ constituent) portfolios
  • It allows for solving portfolio optimization problems with quadratic constraints
  • It allows robust solutions (Ceria et al. 2006) to be considered alongside standard non-robust mean-variance solutions
  • It allows for multi-period optimization solutions encompassing a planning horizon that includes more than one-step-ahead rebalancing

PortfolioAnalytics uses xts and R base plotting to construct many charts of the analytical output.

Related Work

PortfolioAnalytics is considered a 'core' project for financial analysis in R. This project seeks to extend the functionality and make it more useful to more people and for more solver targets (portfolio objectives). That said, several well-known packages may cover similar functionality and could be used as dependencies or referenced in the development of this package:

  1. The R package FactorAnalytics contains fitting and analysis methods for the three main types of factor models used in conjunction with portfolio construction, optimization and risk management, namely fundamental factor models, time series factor models and statistical factor models. It also provides the covariance matrix for use by PerformanceAnalytics mean-variance optimization.
  2. Another R package, PerformanceAnalytics, provides an extensive set of functions for evaluating performance and risk characteristics of funds, assets, or portfolios.
  3. fPortfolio provides a traditional optimization framework and excellent graphics. It supports an asset allocation workflow well, however the original author - a significant contributor to the R and finance community - passed away and new functionality seems unlikely.

Details

Add the conical optimizer from the package cvxr ((see Fu, Narasimhan, and Boyd (2020)) in a way that is implemented consistently with other optimizers in PortfolioAnalytics.

Add constraints and objectives to the PortfolioAnalytics package that can be solved with a conical optimizer. See Tables 1-3 in Perrin and Roncalli (2020) for ideas. Also see Markowitz et al. (2020) for semivariance objectives.

Write vignettes showing how the package and/or functions might be applied in practice or with example data. Demonstrate how the new optimizer allows a user to produce multi-period optimizations Boyd et al. (2017) and/or take drawdown into account Nystrup et al. (2019).

Mentors

Students, please contact mentors below after completing at least one of the tests below.

Tests

Students, please do one or more of the following tests before contacting the mentors:

  • Demonstrate how to use PortfolioAnalytics to construct a mean-variance optimized (MVO) portfolio.
  • Compare the results of the MVO optimization to an Equal-Weighted (EW) portfolio with the same assets.
  • Demonstrate use of the cvxr package for portfolio optimization.
  • Complete the exercises found at this link.

In addition to the test above, applicants should demonstrate that they have:

  • A very good working knowledge of programming in R
  • Familiarity with the construction of R packages
  • Good coding standards (Google’s R style guide)
  • Experience with multivariate statistics
  • Experience with GitHub

Students, please email the results of your tests to the mentors and add a link to your profile or website below.

Brian Peterson: [email protected]
Justin M. Shea: [email protected]
Peter Carl: [email protected]

Note on Proposals

Students should propose a realistic project plan. Quality is more important than quantity, so your proposal may not contain all sections or targeted functionality.

References

  • Boyd, Stephen, Enzo Busseti, Steven Diamond, Ronald N Kahn, Kwangmoo Koh, Peter Nystrup, and Jan Speth. 2017. “Multi-Period Trading via Convex Optimization.” arXiv Preprint arXiv:1705.00109.
  • Fu, Anqi, Balasubramanian Narasimhan, and Stephen Boyd. 2020. “CVXR: An R Package for Disciplined Convex Optimization.” Journal of Statistical Software 94 (14): 1–34. https://doi.org/10.18637/jss.v094.i14.
  • Markowitz, Harry M., David Starer, Harvey Fram, and Sander Gerber. 2020. “Avoiding the Downside: A Practical Review of the Critical Line Algorithm for Meansemivariance Portfolio Optimization.” In Handbook of Applied Investment Research, 369–415. WORLD SCIENTIFIC. https://ideas.repec.org/h/wsi/wschap/9789811222634_0017.html.
  • Nystrup, Peter, Stephen Boyd, Erik Lindström, and Henrik Madsen. 2019. “Multi-Period Portfolio Selection with Drawdown Control.” Annals of Operations Research 282 (1): 245–71.
  • Perrin, Sarah, and Thierry Roncalli. 2020. “Machine Learning Optimization Algorithms & Portfolio Allocation.” Machine Learning for Asset Management: New Developments and Financial Applications, 261–328.
  • Ceria, Sebastián & Stubbs, Robert. (2006). Incorporating estimation errors into portfolio selection: Robust portfolio construction. Journal of Asset Management. 7. 10.1057/palgrave.jam.2240207.
  • PAVLO A. Krokhmal (2007) Higher moment coherent risk measures, Quantitative Finance, 7:4, 373-387, DOI: 10.1080/14697680701458307
  • Sivaramakrishnan, Kartik & Jeet, Vishv & Vandenbussche, Dieter. (2015). Multi-period portfolio optimization with alpha decay.
Clone this wiki locally