This PCRA R package is a companion to the book Robust Portfolio Construction and Risk Analysis by R. Douglas Martin, Thomas K. Philips, Stoyan Stoyanov, Bernd Scherer and Kirk Li, scheduled for publication by Springer in 2024.

The paper “Robust Statistics for Portfolio Construction and Analysis” by R. Douglas Martin, Stoyan V. Stoyanov, Kirk Li and Mahmoud Shammaa, will be published by The Journal of Portfolio Management in September 2023. The Abstract for the paper is available at Paper Abstract.

The R script file RobustStatisticsForPortfoliosJPM2023.R for reproducing most of the Figures and Tables in the above paper is available in the PCRA package folder PCRA/demo. Download that R script by going to PCRA/demo and double clicking on the file, which then allows you to either click on the “Download raw file” link or the “Copy raw file” link. If you have RStudio installed, the first choice may open the file in RStudio. Otherwise you can paste the file into an empty R script.

If you have any problems with the code, please send emails to both Doug Martin at and Kirk Li at We will post responses in this README file.