Package: PerformanceAnalytics 2.0.6

PerformanceAnalytics: Econometric Tools for Performance and Risk Analysis

Collection of econometric functions for performance and risk analysis. In addition to standard risk and performance metrics, this package aims to aid practitioners and researchers in utilizing the latest research in analysis of non-normal return streams. In general, it is most tested on return (rather than price) data on a regular scale, but most functions will work with irregular return data as well, and increasing numbers of functions will work with P&L or price data where possible.

Authors:Brian G. Peterson [cre, aut, cph], Peter Carl [aut, cph], Kris Boudt [ctb, cph], Ross Bennett [ctb], Joshua Ulrich [ctb], Eric Zivot [ctb], Dries Cornilly [ctb], Eric Hung [ctb], Matthieu Lestel [ctb], Kyle Balkissoon [ctb], Diethelm Wuertz [ctb], Anthony Alexander Christidis [ctb], R. Douglas Martin [ctb], Zeheng 'Zenith' Zhou [ctb], Justin M. Shea [ctb], Dhairya Jain [ctb]

PerformanceAnalytics_2.0.6.tar.gz
PerformanceAnalytics_2.0.6.zip(r-4.5)PerformanceAnalytics_2.0.6.zip(r-4.4)PerformanceAnalytics_2.0.6.zip(r-4.3)
PerformanceAnalytics_2.0.6.tgz(r-4.4-x86_64)PerformanceAnalytics_2.0.6.tgz(r-4.4-arm64)PerformanceAnalytics_2.0.6.tgz(r-4.3-x86_64)PerformanceAnalytics_2.0.6.tgz(r-4.3-arm64)
PerformanceAnalytics_2.0.6.tar.gz(r-4.5-noble)PerformanceAnalytics_2.0.6.tar.gz(r-4.4-noble)
PerformanceAnalytics_2.0.6.tgz(r-4.4-emscripten)PerformanceAnalytics_2.0.6.tgz(r-4.3-emscripten)
PerformanceAnalytics.pdf |PerformanceAnalytics.html
PerformanceAnalytics/json (API)
NEWS

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

Peer review:

Bug tracker:https://github.com/braverock/performanceanalytics/issues

Datasets:
  • edhec - EDHEC-Risk Hedge Fund Style Indices
  • managers - Hypothetical Alternative Asset Manager and Benchmark Data
  • portfolio_bacon - Bacon(2008) Data
  • prices - Selected Price Series Example Data
  • test_returns - Sample sector returns for use by unit tests
  • test_weights - Sample sector weights for use by unit tests
  • weights - Selected Portfolio Weights Data

On CRAN:

16.02 score 207 stars 22 packages 4.5k scripts 38k downloads 93 mentions 277 exports 4 dependencies

Last updated 21 days agofrom:805a5380d8. Checks:OK: 1 NOTE: 8. Indexed: yes.

TargetResultDate
Doc / VignettesOKOct 16 2024
R-4.5-win-x86_64NOTEOct 16 2024
R-4.5-linux-x86_64NOTEOct 16 2024
R-4.4-win-x86_64NOTEOct 16 2024
R-4.4-mac-x86_64NOTEOct 16 2024
R-4.4-mac-aarch64NOTEOct 16 2024
R-4.3-win-x86_64NOTEOct 16 2024
R-4.3-mac-x86_64NOTEOct 16 2024
R-4.3-mac-aarch64NOTEOct 16 2024

Exports:ActivePremiumActiveReturnAdjustedSharpeRatioallsymbolsapply.fromstartapply.rollingAppraisalRatioAverageDrawdownAverageLengthAverageRecoveryBernardoLedoitRatioBetaCoKurtosisBetaCoSkewnessBetaCoVariancebluefocusbluemonobond.datesbond.labelsBurkeRatioCalculateReturnsCalmarRatioCAPM.alphaCAPM.betaCAPM.beta.bearCAPM.beta.bullCAPM.CMLCAPM.CML.slopeCAPM.dynamicCAPM.epsilonCAPM.jensenAlphaCAPM.RiskPremiumCAPM.SML.slopeCDaR.alphaCDaR.betaCDDcenteredcomomentcenteredmomentchart.ACFchart.ACFpluschart.Barchart.BarVaRchart.Boxplotchart.CaptureRatioschart.Correlationchart.CumReturnschart.Drawdownchart.ECDFchart.Eventschart.Histogramchart.QQPlotchart.Regressionchart.RelativePerformancechart.RiskReturnScatterchart.RollingCorrelationchart.RollingMeanchart.RollingPerformancechart.RollingQuantileRegressionchart.RollingRegressionchart.Scatterchart.SFMchart.SnailTrailchart.StackedBarchart.TimeSerieschart.VaRSensitivitycharts.Barcharts.BarVaRcharts.PerformanceSummarycharts.RollingPerformancecharts.RollingRegressioncharts.TimeSeriescheckDataclean.boudtclosedsymbolsCoKurtosisCoKurtosisMatrixCoSkewnessCoSkewnessMatrixCoVarianceCVaRcycles.datesdark6equaldark8equalderportm2derportm3derportm4DownsideDeviationDownsideFrequencyDownsidePotentialDownsideSharpeRatioDRatioDrawdownDeviationDrawdownPeakDrawdownsequity.datesequity.labelsESETLFamaBetafillsymbolsfindDrawdownsFrequencygreenfocusgreenmonogrey6monogrey8monoHurstIndexInformationRatioKappaKellyRatiokurtosislegendlinesymbolslpmM2.ewmaM2.shrinkM2.structM2SortinoM3.ewmaM3.mat2vecM3.MCAM3.MMM3.shrinkM3.structM3.vec2matM4.ewmaM4.mat2vecM4.MCAM4.MMM4.shrinkM4.structM4.vec2matmacro.datesmacro.labelsMarketTimingMartinRatiomaxDrawdownmean.geometricmean.LCLmean.stderrmean.UCLMeanAbsoluteDeviationMinTrackRecordMM.NCEModiglianiMSquaredMSquaredExcessNetSelectivityOmegaOmegaExcessReturnOmegaSharpeRatioopensymbolsPainIndexPainRatioportm2portm3portm4ProbSharpeRatioProspectRatioRachevRatiorainbow10equalrainbow12equalrainbow6equalrainbow8equalredfocusredmonoReturn.annualizedReturn.annualized.excessReturn.calculateReturn.centeredReturn.cleanReturn.cumulativeReturn.excessReturn.GeltnerReturn.locScaleRobReturn.portfolioReturn.readReturn.rebalancingReturn.relativerich10equalrich12equalrich6equalrich8equalrisk.datesrisk.labelsRPESE.controlsd.annualizedsd.multiperiodSelectivitySemiDeviationSemiSDSemiVarianceset6equalset8equalSFM.alphaSFM.betaSFM.beta.bearSFM.beta.bullSFM.CMLSFM.CML.slopeSFM.coefficientsSFM.dynamicSFM.epsilonSFM.fit.modelsSFM.jensenAlphaSharpeRatioSharpeRatio.annualizedSharpeRatio.modifiedskewnessSkewnessKurtosisRatioSmoothingIndexsortDrawdownsSortinoRatioSpecificRiskStdDevStdDev.annualizedSterlingRatioSystematicRisktable.AnnualizedReturnstable.Arbitrarytable.Autocorrelationtable.CalendarReturnstable.CAPMtable.CaptureRatiostable.Correlationtable.Distributionstable.DownsideRisktable.DownsideRiskRatiotable.Drawdownstable.DrawdownsRatiotable.HigherMomentstable.InformationRatiotable.ProbOutPerformancetable.RollingPeriodstable.SFMtable.SpecificRisktable.Statstable.TrailingPeriodstable.UpDownRatiostable.Variabilitytextplottim10equaltim12equaltim6equaltim8equalTimingRatioto.monthly.contributionsto.period.contributionsto.quarterly.contributionsto.weekly.contributionsto.yearly.contributionstol10qualitativetol11qualitativetol12qualitativetol14rainbowtol15rainbowtol18rainbowtol1qualitativetol21rainbowtol2qualitativetol3qualitativetol4qualitativetol5qualitativetol6qualitativetol7qualitativetol8qualitativetol9qualitativeTotalRiskTrackingErrorTreynorRatioUlcerIndexUpDownRatiosUpsideFrequencyUpsidePotentialRatioUpsideRiskVaRVolatilitySkewnesszerofill

Dependencies:latticequadprogxtszoo

Estimation of Higher Order Moments

Rendered fromEstimationComoments.Rnwusingutils::Sweaveon Oct 16 2024.

Last update: 2021-07-17
Started: 2017-08-01

How to Present Tables in Plot Devices

Rendered fromtextplotPresentation-CRUG-2011.Rnwusingutils::Sweaveon Oct 16 2024.

Last update: 2020-02-05
Started: 2014-02-20

PerformanceAnalytics Charts and Tables Presentation - Meielisalp - 2007

Rendered fromPerformanceAnalyticsChartsPresentation-Meielisalp-2007.Rnwusingutils::Sweaveon Oct 16 2024.

Last update: 2014-09-15
Started: 2014-02-20

PerformanceAnalytics Charts and Tables Reference

Rendered fromPA-charts.Rnwusingutils::Sweaveon Oct 16 2024.

Last update: 2014-02-23
Started: 2014-02-20

PerformanceAnalytics Data Mining Presentation - UseR - 2007

Rendered fromPerformanceAnalyticsPresentation-UseR-2007.Rnwusingutils::Sweaveon Oct 16 2024.

Last update: 2014-09-15
Started: 2014-02-20

Portfolio Returns

Rendered fromportfolio_returns.Rnwusingutils::Sweaveon Oct 16 2024.

Last update: 2020-02-01
Started: 2014-06-22

Standard Errors for Risk and Performance Estimators

Rendered fromPA_StandardErrors.pdf.asisusingR.rsp::asison Oct 16 2024.

Last update: 2020-01-03
Started: 2020-01-03

Readme and manuals

Help Manual

Help pageTopics
Econometric tools for performance and risk analysis.PerformanceAnalytics-package PerformanceAnalytics
Wrapper for SFM's regression models..coefficients
Active Premium or Active ReturnActivePremium ActiveReturn
Adjusted Sharpe ratio of the return distributionAdjustedSharpeRatio
calculate a function over an expanding window always starting from the beginning of the seriesapply.fromstart
calculate a function over a rolling windowapply.rolling
Appraisal ratio of the return distributionAppraisalRatio
Calculates the average depth of the observed drawdowns.AverageDrawdown
Calculates the average length (in periods) of the observed drawdowns.AverageLength
Calculates the average length (in periods) of the observed recovery period.AverageRecovery
Bernardo and Ledoit ratio of the return distributionBernardoLedoitRatio
Functions to calculate systematic or beta co-moments of return seriesBetaCoKurtosis BetaCoMoments BetaCoSkewness BetaCoVariance SystematicKurtosis SystematicSkewness
Burke ratio of the return distributionBurkeRatio
calculate a Calmar or Sterling reward/risk ratio Calmar and Sterling Ratios are yet another method of creating a risk-adjusted measure for ranking investments similar to the 'SharpeRatio'.CalmarRatio SterlingRatio
utility functions for single factor (CAPM) CML, SML, and RiskPremiumCAPM.CML CAPM.CML.slope CAPM.RiskPremium CAPM.SML.slope CAPM.utils SFM.CML SFM.CML.slope SFM.RiskPremium SFM.SML.slope SFM.utils
Time-varying conditional single factor model betaCAPM.dynamic SFM.dynamic
Regression epsilon of the return distributionCAPM.epsilon SFM.epsilon
Jensen's alpha of the return distributionCAPM.jensenAlpha SFM.jensenAlpha
Conditional Drawdown alphaCDaR.alpha
Conditional Drawdown betaCDaR.beta
Calculate Uryasev's proposed Conditional Drawdown at Risk (CDD or CDaR) measureCDaR CDD
Create ACF chart or ACF with PACF two-panel chartchart.ACF chart.ACFplus
wrapper for barchart of returnschart.Bar charts.Bar
Periodic returns in a bar chart with risk metric overlaychart.BarVaR charts.BarVaR
box whiskers plot wrapperchart.Boxplot
Chart of Capture Ratios against a benchmarkchart.CaptureRatios
correlation matrix chartchart.Correlation
Cumulates and graphs a set of periodic returnschart.CumReturns
Time series chart of drawdowns through timechart.Drawdown
Create an ECDF overlaid with a Normal CDFchart.ECDF
Plots a time series with event dates alignedchart.Events
histogram of returnschart.Histogram
Plot a QQ chartchart.QQPlot
Takes a set of returns and relates them to a market benchmark in a scatterplotchart.Regression
relative performance chart between multiple return serieschart.RelativePerformance
scatter chart of returns vs risk for comparing multiple instrumentschart.RiskReturnScatter
chart rolling correlation fo multiple assetschart.RollingCorrelation
chart the rolling mean returnchart.RollingMean
wrapper to create a chart of rolling performance metrics in a line chartchart.RollingPerformance
A wrapper to create charts of relative regression performance through timechart.RollingQuantileRegression chart.RollingRegression charts.RollingRegression
wrapper to draw scatter plot with sensible defaultschart.Scatter
Compare SFM estimated using robust estimators with that estimated by OLSchart.SFM
chart risk versus return over rolling time periodschart.SnailTrail
create a stacked bar plotchart.StackedBar
Creates a time series chart with some extensions.chart.TimeSeries chart.TimeSeries.base chart.TimeSeries.builtin chart.TimeSeries.dygraph chart.TimeSeries.ggplot2 chart.TimeSeries.googlevis chart.TimeSeries.plotly charts.TimeSeries
show the sensitivity of Value-at-Risk or Expected Shortfall estimateschart.VaRSensitivity
Create combined wealth index, period performance, and drawdown chartcharts.PerformanceSummary
rolling performance chartcharts.RollingPerformance
check input data type and format and coerce to the desired output typecheckData
Check 'seedValue' to ensure it is compatible with coredata_content attribute of 'R' (an xts object)checkSeedValue
clean extreme observations in a time series to to provide more robust risk estimatesclean.boudt
Functions for calculating comoments of financial time seriesCoKurtosis CoKurtosisMatrix CoMoments CoSkewness CoSkewnessMatrix CoVariance M3.MM M4.MM
downside risk (deviation, variance) of the return distributionDownsideDeviation DownsidePotential SemiDeviation SemiSD SemiVariance
downside frequency of the return distributionDownsideFrequency
Downside Sharpe RatioDownsideSharpeRatio
d ratio of the return distributionDRatio
Calculates a standard deviation-type statistic using individual drawdowns.DrawdownDeviation
Drawdawn peak of the return distributionDrawdownPeak
Find the drawdowns and drawdown levels in a timeseries.Drawdowns findDrawdowns
EDHEC-Risk Hedge Fund Style Indicesedhec
calculates Expected Shortfall(ES) (or Conditional Value-at-Risk(CVaR) for univariate and component, using a variety of analytical methods.CVaR ES ETL
Functions for calculating EWMA comoments of financial time seriesEWMAMoments M2.ewma M3.ewma M4.ewma
Fama beta of the return distributionFamaBeta
Frequency of the return distributionFrequency
calculate the Hurst Index The Hurst index can be used to measure whether returns are mean reverting, totally random, or persistent.HurstIndex
InformationRatio = ActivePremium/TrackingErrorInformationRatio
Kappa of the return distributionKappa
calculate Kelly criterion ratio (leverage or bet size) for a strategyKellyRatio
Kurtosiskurtosis
Calculate appropriate cumulative return series or asset level using xts attribute informationLevel.calculate
calculate a lower partial moment for a time serieslpm
M squared for Sortino of the return distributionM2Sortino
Hypothetical Alternative Asset Manager and Benchmark Datamanagers
Market timing modelsMarketTiming
Martin ratio of the return distributionMartinRatio
caclulate the maximum drawdown from peak equitymaxDrawdown
Functions for doing Moment Component Analysis (MCA) of financial time seriesM3.MCA M4.MCA MCA
calculate attributes relative to the mean of the observation series given, including geometric, stderr, LCL and UCLmean.arithmetic mean.geometric mean.LCL mean.stderr mean.UCL mean.utils
Mean absolute deviation of the return distributionMeanAbsoluteDeviation
Minimum Track Record LengthMinTrackRecord
Modigliani-Modigliani measureModigliani
M squared of the return distributionMSquared
M squared excess of the return distributionMSquaredExcess
Functions for calculating the nearest comoment estimator for financial time seriesMM.NCE NCE
Net selectivity of the return distributionNetSelectivity
calculate Omega for a return seriesOmega
Omega excess return of the return distributionOmegaExcessReturn OmegaExessReturn
Omega-Sharpe ratio of the return distributionOmegaSharpeRatio
Pain index of the return distributionPainIndex
Pain ratio of the return distributionPainRatio
Bacon(2008) Dataportfolio_bacon
Portfolio momentsderportm2 derportm3 derportm4 portfolio-moments portm2 portm3 portm4
Selected Price Series Example Dataprices
Probabilistic Sharpe RatioProbSharpeRatio
Prospect ratio of the return distributionProspectRatio
Rachev RatioRachevRatio
Display text information in a graphics plot.replaceTabs replaceTabs.inner textplot textplot.character textplot.data.frame textplot.default textplot.matrix
calculate an annualized return for comparing instruments with different length historyReturn.annualized
calculates an annualized excess return for comparing instruments with different length historyReturn.annualized.excess
calculate simple or compound returns from pricesCalculateReturns Return.calculate
calculate centered Returnscenteredcomoment centeredmoment Return.centered
clean returns in a time series to to provide more robust risk estimatesReturn.clean
Convert coredata content from one type of return to anotherReturn.convert
calculate a compounded (geometric) cumulative returnReturn.cumulative
Calculates the returns of an asset in excess of the given risk free rateReturn.excess
calculate Geltner liquidity-adjusted return seriesReturn.Geltner
Robust Filter for Time Series ReturnsReturn.locScaleRob
Calculate weighted returns for a portfolio of assetsReturn.portfolio Return.rebalancing
Read returns data with different date formatsReturn.read
calculate the relative return of one asset to anotherReturn.relative
Controls Function for the Computation of Standard Errors for Risk and Performance estimatorsRPESE.control
Selectivity of the return distributionSelectivity
Calculate single factor model (CAPM) alphaCAPM.alpha SFM.alpha
Calculate single factor model (CAPM) betaCAPM.beta CAPM.beta.bear CAPM.beta.bull SFM.beta SFM.beta.bear SFM.beta.bull TimingRatio
Calculate single factor model alpha and beta coefficientsSFM.coefficients
Compare SFM estimated using robust estimators with that estimated by OLSSFM.fit.models
calculate a traditional or modified Sharpe Ratio of Return over StdDev or VaR or ESSharpeRatio SharpeRatio.modified
calculate annualized Sharpe RatioSharpeRatio.annualized
Functions for calculating shrinkage-based comoments of financial time seriesM2.shrink M3.shrink M4.shrink ShrinkageMoments
Skewnessskewness
Skewness-Kurtosis ratio of the return distributionSkewness-KurtosisRatio SkewnessKurtosisRatio
calculate Normalized Getmansky Smoothing IndexSmoothingIndex
order list of drawdowns from worst to bestsortDrawdowns
calculate Sortino Ratio of performance over downside riskSortinoRatio
Specific risk of the return distributionSpecificRisk
calculates Standard Deviation for univariate and multivariate series, also calculates component contribution to standard deviation of a portfolioStdDev
calculate a multiperiod or annualized Standard Deviationsd.annualized sd.multiperiod StdDev.annualized
Functions for calculating structured comoments of financial time seriesM2.struct M3.struct M4.struct StructuredMoments
Systematic risk of the return distributionSystematicRisk
Annualized Returns Summary: Statistics and Stylized Factstable.AnnualizedReturns
wrapper function for combining arbitrary function list into a tablestatsTable table.Arbitrary
table for calculating the first six autocorrelation coefficients and significancetable.Autocorrelation
Monthly and Calendar year Return tabletable.CalendarReturns table.Returns
Calculate and display a table of capture ratio and related statisticstable.CaptureRatios table.UpDownRatios
calculate correlalations of multicolumn datatable.Correlation
Distributions Summary: Statistics and Stylized Factstable.Distributions
Downside Risk Summary: Statistics and Stylized Factstable.DownsideRisk
Downside Summary: Statistics and ratiostable.DownsideRiskRatio
Worst Drawdowns Summary: Statistics and Stylized Factstable.Drawdowns
Drawdowns Summary: Statistics and ratiostable.DrawdownsRatio
Higher Moments Summary: Statistics and Stylized Factstable.HigherMoments
Information ratio Summary: Statistics and Stylized Factstable.InformationRatio
Outperformance Report of Asset vs Benchmarktable.ProbOutPerformance
Rolling Periods Summary: Statistics and Stylized Factstable.RollingPeriods table.TrailingPeriods table.TrailingPeriodsRel
Single Factor Asset-Pricing Model Summary: Statistics and Stylized Factstable.CAPM table.SFM
Specific risk Summary: Statistics and Stylized Factstable.SpecificRisk
Returns Summary: Statistics and Stylized Factstable.MonthlyReturns table.Stats
Variability Summary: Statistics and Stylized Factstable.Variability
Sample sector returns for use by unit teststest_returns
Sample sector weights for use by unit teststest_weights
Aggregate contributions through timeto.monthly.contributions to.period.contributions to.quarterly.contributions to.weekly.contributions to.yearly.contributions
Total risk of the return distributionTotalRisk
Calculate Tracking Error of returns against a benchmarkTrackingError
calculate Treynor Ratio or modified Treynor Ratio of excess return over CAPM betaTreynorRatio
calculate the Ulcer IndexUlcerIndex
Helper function for comoment matricesM3.mat2vec M3.vec2mat M4.mat2vec M4.vec2mat unique-comoments
calculate metrics on up and down markets for the benchmark assetUpDownRatios
upside frequency of the return distributionUpsideFrequency
calculate Upside Potential Ratio of upside performance over downside riskUPR UpsidePotentialRatio
upside risk, variance and potential of the return distributionUpsideRisk
calculate various Value at Risk (VaR) measuresVaR VaR.CornishFisher
Volatility and variability of the return distributionVolatilitySkewness
Selected Portfolio Weights Dataweights
zerofillzerofill