Package: PCRA 1.3.1

Doug Martin

PCRA: Companion to Portfolio Construction and Risk Analysis

A collection of functions and data sets that support teaching a quantitative finance MS level course on Portfolio Construction and Risk Analysis, and the writing of a textbook for such a course. The package is unique in providing several real-world data sets that may be used for problem assignments and student projects. The data sets include cross-sections of stock data from the Center for Research on Security Prices, LLC (CRSP), corresponding factor exposures data from S&P Global, and several SP500 data sets.

Authors:Doug Martin [cre, aut], Alexios Galanos [ctb], Kirk Li [aut, ctb], Jon Spinney [ctb], Thomas Philips [ctb]

PCRA_1.3.1.tar.gz
PCRA_1.3.1.zip(r-4.7)PCRA_1.3.1.zip(r-4.6)PCRA_1.3.1.zip(r-4.5)
PCRA_1.3.1.tgz(r-4.6-any)PCRA_1.3.1.tgz(r-4.5-any)
PCRA_1.3.1.tar.gz(r-4.7-any)PCRA_1.3.1.tar.gz(r-4.6-any)
PCRA_1.3.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION
card.svg |card.png
PCRA/json (API)

# Install 'PCRA' in R:
install.packages('PCRA', repos = c('https://robustport.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/robustport/pcra/issues

Datasets:

On CRAN:

Conda:

6.69 score 5 stars 401 downloads 43 exports 127 dependencies

Last updated from:dea6a6f59f. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK328
source / vignettesOK394
linux-release-x86_64OK270
macos-release-arm64OK157
macos-oldrel-arm64OK166
windows-develOK218
windows-releaseOK177
windows-oldrelOK196
wasm-releaseOK229

Exports:abbreviate_namebarplotWtsbootEfrontsbuildPortfolioschart.EfrontcleanOutliersdivHHIellipsesPlotPCRA.covfmewmaMeanVolgetPCRADataKRestlevgLongShortmathEfrontmathEfrontCashRiskymathEfrontRiskymathEfrontRiskyMuCovmathGmvmathGmvMuCovmathTportmathWtsEfrontRiskymathWtsEfrontRiskyMuCovmeanReturns4TypesminVarCashRiskyminVarRiskyLOopt.outputMvoPCRAplotLSandHuberRobustSFMplotLSandRobustSFMpsiHuberqqnormDatWindatreturnsCRSPxtsrunMultipleBacktestsrunPortfolioBacktestselectCRSPandSPGMISKeststocksCRSPxtsto_monthlyto_weeklytransferCoeftsPlotMPturnOverupdate_dev_pkgwinsorizewinsorMean

Dependencies:askpassbackportsbase64encbootbrewbriobslibcachemcallrcheckmateclicliprcodetoolscommonmarkcorpcorcpp11crayoncredentialscurldata.tableDEoptimRdescdevtoolsdiffobjdigestdownlitellipsisevaluatefansifastmapfontawesomeforeachfsGenSAgertgitcredsgluehighrhtmltoolshtmlwidgetshttpuvhttr2iniiteratorsjquerylibjsonliteknitrlaterlatticelifecyclemagrittrMASSmcomemoisemimeminiUImvtnormopensslotelpakpcaPPPerformanceAnalyticspillarpkgbuildpkgconfigpkgdownpkgloadPortfolioAnalyticspraiseprettyunitsprocessxprofvispromisespspsopurrrpyinitquadprogR.cacheR.methodsS3R.ooR.utilsR6raggrappdirsrcmdcheckRcppregistryrlangrmarkdownRobStatTMrobustbaseROIROI.plugin.symphonyroxygen2rprojrootrrcovrstudioapiRsymphonyrversionssasssessioninfoshinyslamsourcetoolsstringisyssystemfontstestthattextshapingtibbletinytexurlcheckerusethisutf8vctrswaldowhiskerwithrxfunxml2xopenxtablextsyamlzipzoo

CRSP Stocks and SPGMI Factors in PCRA
1 Introduction | 2 The CRSP® Stocks and SPGMI Factors Data Sets | 3 Selecting CRSP® Stocks and SPGMI Factors Data | 4 Using Weekly and Daily CRSP® Data and Unrounded SPGMI Data | 5 Basic Data.Table Manipulations | 6 CRSP® Stocks Market Capitalization Break Points | 7 Names of CRSP® Items in stocksCRSPmonthly Data Set

Last update: 2026-07-14
Started: 2026-07-14

PCRA Package and Data Overview
1 The PCRA Package | 2 Basics of the CRAN PCRA Package | 3 Development Version of PCRA | 4 Concluding Comment

Last update: 2026-07-14
Started: 2026-07-14

PCRA Reproducibility Code
1 R and RStudio | 2 PCRA Reproducibility Code | 3 Devtools and Rtools

Last update: 2026-07-14
Started: 2026-07-14

Readme and manuals

Help Manual

Help pageTopics
Abbreviate a vector of namesabbreviate_name
A Barplot of a Set of Portfolio WeightsbarplotWts
Bootstrapped Efficient FrontiersbootEfronts
Build a List of Portfolio Specifications (Default Example)buildPortfolios
CBOE S&P 500 BuyWrite IndexBXMdata
CboeOptionStrategiesCboeOptionStrategies
Create Efficient Frontierchart.Efront
Clean Returns Outliers EffectivelycleanOutliers
ConferenceBoardETIConferenceBoardETI
CRSP Returns for 8 stocks in 4 cap groupscrsp.returns8
CRSP Stocks Cap Groups CountsCRSPLiquidMktCapGrpsCnts
Fama-French 3-Factor Model Weekly Time SeriesdatFF3W
Fama-French 4-Factor Model Weekly Time SeriesdatFF4W
HHI Based Diversification IndexdivHHI
Overlaid Correlations Ellipses PlotsellipsesPlotPCRA.covfm
EWMA Mean and VolatilityewmaMeanVol
SPGMI Data 14 Factors for 294 StocksfactorsSPGMI
Rounded Version of SPGMI Data 14 FactorsfactorsSPGMIr
Federal Reserve Board Interest RatesFRBinterestRates
Download CRSP and SPGMI DatagetPCRAData
Five German Investment Fundsgfunds5
Hedge Fund Strategies ReturnsHFstrategies
Invensys Earnings per ShareinvensysEPS
Kurtosis EstimatorKRest
Long Short Portfolio LeveragelevgLongShort
Global Baskets of Equity and BondsMarketData
Efficient Frontiers from ReturnsmathEfront
Math Efficient Frontier: Cash and Risky AssetsmathEfrontCashRisky
Efficient Frontier of Risky StocksmathEfrontRisky
Efficient FrontiermathEfrontRiskyMuCov
Global Minimum Variance Portfolio (GMV)mathGmv
Global Minimum Variance Portfolios From Mu and CovmathGmvMuCov
Tangency Portfolio WeightsmathTport
Efficient Frontier Portfolio Weights VectorsmathWtsEfrontRisky
Efficient Frontier Portfolio Weights VectorsmathWtsEfrontRiskyMuCov
Four Types of Mean ReturnsmeanReturns4Types
Minimum Variance PortfoliominVarCashRisky
Title Minimum Variance Long-Only Risky Assets PortfoliominVarRiskyLO
Optimal Portfolio Weights and Performanceopt.outputMvoPCRA
Plot LS and Huber SFM FitsplotLSandHuberRobustSFM
Robust and Least Square Single Factor Model (SFM) FitsplotLSandRobustSFM
Huber psi functionpsiHuber
qqnormDatWindatqqnormDatWindat
CRSP Returns of Stock with Ticker DDretDD
CRSP Returns of Stock with Ticker EDSretEDS
CRSP Returns of Stock with Ticker FNBretFNB
CRSP Returns of Stock with Ticker KBHretKBH
CRSP Returns of Stock with Ticker MERretMER
CRSP Returns of Stock with Ticker OFGretOFG
CRSP Returns of Stock with Ticker PSCretPSC
Select CRSP Stocks ReturnsreturnsCRSPxts
CRSP Returns of Stock with Ticker VHIretVHI
CRSP Returns of Stock with Ticker WTSretWTS
Run Multiple Portfolio Backtests and PlotrunMultipleBacktests
Run Portfolio Backtest and PlotrunPortfolioBacktest
Select and merge data from the stocksCRSP and factorsSPGMI data setsselectCRSPandSPGMI
ShortDurationCreditShortDurationCredit
Skewness estimatorSKest
SP400IndustrialsSP400Industrials
SP425IndustrialsSP425Industrials
SP500SP500
SP500dataSP500data
SP500from1967to2007SP500from1967to2007
SPIndustrialsSPIndustrials
CRSP daily stocks data for 294 stocksstocksCRSPdaily
stocksCRSPmonthlystocksCRSPmonthly
CRSP weekly stocks data for 294 stocksstocksCRSPweekly
Select CRSP Stocks ReturnsstocksCRSPxts
Function to convert from daily to weekly returns.to_monthly
Function to convert from daily to weekly returns.to_weekly
Transfer CoefficenttransferCoef
Lattice Multi-Panel Time Series PlotstsPlotMP
Portfolio TurnoverturnOver
Update to Developer version on Github that have access to additional functions and dataupdate_dev_pkg
USTreasuryTradewebUSTreasuryTradeweb
Winsorize Datawinsorize
Winsorized MeanwinsorMean