Meucci GSOC 2013


Extend the functionality of the Meucci package with additional research by Attilio Meucci, a thought leader in risk and portfolio management.


Attilio Meucci is a pioneer in advanced risk and portfolio management. His innovations include Entropy Pooling (technique for fully flexible portfolio construction), Factors on Demand (on-the-fly factor model for optimal hedging), Effective Number of Bets (entropy-eigenvalue statistic for diversification management), Fully Flexible Probabilities (technique for on-the-fly stress-test and estimation without re-pricing), and Copula-Marginal Algorithm (algorithm to generate panic copulas). Attilio Meucci serves as the chief risk officer at Kepos Capital LP. Concurrently, he is adjunct professor at the Master’s in Financial Engineering – Baruch College - CUNY.

Prof. Meucci frequently includes Matlab code alongside his key papers to better demonstrate the concepts. We have started and would like to continue to convert that code to R to make it more widely assessible.

During last summer’s GSoC, we sponsored a related project that benefited from a very generous contribution of ported code from Ram Ahluwalia at Wingfoot Capital. The project focused on that code contribution and established a stand-alone package named Meucci that is now available on r-forge at That package now contains twenty-some exported functions and six demos, along with some degree of documentation for most of them. There is still much to do here, but the package will provide a good foundation for the proposed work.

All of Meucci’s original MATLAB source is available on, where you can examine the extensive material he makes available.

Beyond the initial conversion of functions from the MATLAB code, we will functionalize certain functions to include in PerformanceAnalytics, PortfolioAnalytics, or developing a package around one or more of the concepts described above, starting with the Effective Number of Bets. PerformanceAnalytics is an R package that provides a collection of econometric functions for performance and risk analysis. PortfolioAnalytics is an extensible business-focused framework for portfolio optimization and analysis.

This project will be pursued in three pieces. In the first, the student will focus on Meucci (2012), where he provides a framework for computing, stress-testing, and managing liquidity risk, funding risk and market risk in fully general multi-asset class portfolio. Specifically, this will include porting Meucci’s MATLAB code and carefully verifying the resulting calculations to ensure that results match, from the following papers:

  • Meucci, A., 2012, Fully Integrated Liquidity and Market Risk Model. Financial Analysts Journal, Forthcoming. Available at SSRN: or
  • Meucci, A., 2008, Fully Flexible Views: Theory and practice, Risk 21, 97—102 Article and code available at
  • Meucci, A., 2010, Historical scenarios with Fully Flexible Probabilities, GARP Risk Professional December, 40—43 Article and code available at
  • Meucci, A., 2012, Effective number of scenarios with Fully Flexible Probabilities, GARP Risk Professional February, 32—35 Article and code available at
  • Meucci, A., D. Ardia, and S. Keel, 2011, Multivariate parametric Entropy Pooling with fully flexible views, Working Paper Article and code available at

In the second part of the project, the student will functionalize certain workflows to include in PerformanceAnalytics or other appropriate packages. This portion of the project may focus on either the liquidity concept described above, or Meucci’s Effective Number of Bets concept, described in Meucci (2010).

The third part of the project will focus on the continued improvement of the Meucci package. This will include refining functionality to remove the need for the matlab package, identifying and reducing functional overlap, adding more charts and graphs, and improving the documentation and examples.

Skills Required

Applicants should have:

  • A strong interest in finance,
  • Experience using and developing in R, and comfort with tools such as svn, Roxygen2, LaTeX (for equations in particular), and familiarity with base graphics.
  • Demonstrable experience with finance-related packages.
  • The ability to read and run Matlab code to verify results.


A successful applicant will:

  • Discuss the list of proposed functionality and associated visualization for inclusion based on the literature cited here.
  • Develop a specific plan with a timeline for development, documentation (consider adding a vignette as well), and testing the functionality.
  • Provide a complete code example of a function with documentation that could be used in the Meucci package (exceptional examples will be considered for inclusion in the package and their author given full credit for the contribution). The example does not need to pertain directly to the subject of this project, but should demonstrate your coding ability and familiarity with the tools used in developing the Meucci package and PerformanceAnalytics.
  • Clearly identify any other commitments or possible conflicts for their time during the coming summer.


  • Meucci, Attilio, Factors on Demand: Building a Platform for Portfolio Managers, Risk Managers and Traders (April 1, 2010). Risk, Vol. 23, No.7, p. 84-89. Available at SSRN:
  • Meucci, Attilio, Risk and Asset Allocation. Springer Finance (2005) ISBN: 3540222138


David Ardia is a co-author with Attilio Meucci, author of the DEoptim package, and has previously mentored GSoC projects.

Brian Peterson is one of the primary authors of the related packages, and has previously mentored GSoC projects including the Meucci project from GSoC 2012.

Peter Carl is one of the primary authors of the related packages and has previously mentored GSoC projects.

developers/projects/gsoc2013/meucci.txt · Last modified: 2013/04/07 by peter_carl
Recent changes RSS feed R Wiki powered by Driven by DokuWiki and optimized for Firefox Creative Commons License