Learn R Programming

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 martinrd3d@gmail.com and Kirk Li at cocokecoli@gmail.com. We will post responses in this README file.

Copy Link

Version

Install

install.packages('PCRA')

Monthly Downloads

529

Version

1.2

License

GPL-2

Maintainer

Doug Martin

Last Published

August 30th, 2023

Functions in PCRA (1.2)

divHHI

HHI Based Diversification Index
cleanOutliers

Clean Returns Outliers
getPCRAData

Download CRSP and SPGMI Data
gfunds5

gfunds5
invensysEPS

Earnings per Share of Invensys
mathGmvMuCov

Global Minimum Variance Portfolios From Mu and Cov
mathTport

Tangency Portfolio Weights
mathEfrontRisky

Efficient Frontier of Risky Stocks
mathEfrontCashRisky

Math Efficient Frontier: Cash and Risky Assets
mathGmv

Global Minimum Variance Portfolio (GMV)
ellipsesPlotPCRA.covfm

Overlaid Correlations Ellipses Plots
plotLSandRobustSFM

Robust and Least Square Single Factor Model (SFM) Fits
mathEfrontRiskyMuCov

Efficient Frontier
retFNB

Stock with Ticker FNB
qqnormDatWindat

qqnormDatWindat
levgLongShort

Long Short Portfolio Leverage
stocksCRSPxts

Select CRSP Stocks Returns
mathEfront

Efficient Frontiers from Returns
retDD

Stock with Ticker DD
strategies

Hedge Fund Strategies Returns
retPSC

Stock with Ticker PSC
retKBH

Stock with Ticker KBH
retVHI

Stock with Ticker VHI
mathWtsEfrontRisky

Efficient Frontier Portfolio Weights Vectors
winsorize

Winsorize Data
winsorMean

Winsorized Mean
returnsCRSPxts

Select CRSP Stocks Returns
opt.outputMvoPCRA

Optimal Portfolio Weights and Performance
meanReturns4Types

Four Types of Mean Returns
retEDS

Stock with Ticker EDS
retWTS

Stock with Ticker WTS
mathWtsEfrontRiskyMuCov

Efficient Frontier Portfolio Weights Vectors
selectCRSPandSPGMI

Select and merge data from the stocksCRSP and factorsSPGMI data sets
stocksCRSP

stocksCRSP
retMER

Stock with Ticker MER
retOFG

Stock with Ticker OFG
tsPlotMP

Lattice Multi-Panel Time Series Plots
turnOver

Portfolio Turnover
SKest

Skewness estimator
SP425Industrials

SP425Industrials
barplotWts

A Barplot of a Set of Portfolio Weights
KRest

Kurtosis Estimator
chart.Efront

Create Efficient Frontier
FRBinterestRates

Federal Reserve Board Interest Rates
SPIndustrials

SPIndustrials
SP500

SP500
SP400Industrials

SP400Industrials
PCRA-package

PCRA: Companion to Portfolio Construction and Risk Analysis
bootEfronts

Bootstrapped Efficient Frontiers
SP500from1967to2007

SP500from1967to2007
factorsSPGMI

factorsSPGMI
crsp.returns8

crsp.returns8
datFF4W

Fama-French-Carhart Weekly 4-Factor Model
datFF3W

Fama-French Weekly 3-Factor Model