Learn R Programming

⚠️There's a newer version (2.0.8) of this package.Take me there.

PerformanceAnalytics (version 1.4.3541)

Econometric tools for performance and risk analysis

Description

Collection of econometric functions for performance and risk analysis. 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.

Copy Link

Version

Install

install.packages('PerformanceAnalytics')

Monthly Downloads

34,347

Version

1.4.3541

License

GPL-2 | GPL-3

Maintainer

Brian G Peterson

Last Published

September 16th, 2014

Functions in PerformanceAnalytics (1.4.3541)

ActiveReturn

Active Premium or Active Return
CDD

Calculate Uryasev's proposed Conditional Drawdown at Risk (CDD or CDaR) measure
Selectivity

Selectivity of the return distribution
Return.Geltner

calculate Geltner liquidity-adjusted return series
HurstIndex

calculate the Hurst Index The Hurst index can be used to measure whether returns are mean reverting, totally random, or persistent.
OmegaSharpeRatio

Omega-Sharpe ratio of the return distribution
DrawdownDeviation

Calculates a standard deviation-type statistic using individual drawdowns.
DownsideFrequency

downside frequency of the return distribution
Return.portfolio

Calculate weighted returns for a portfolio of assets
MSquaredExcess

M squared excess of the return distribution
NetSelectivity

Net selectivity of the return distribution
chart.Correlation

correlation matrix chart
SortinoRatio

calculate Sortino Ratio of performance over downside risk
kurtosis

Kurtosis
CAPM.epsilon

Regression epsilon of the return distribution
OmegaExcessReturn

Omega excess return of the return distribution
BurkeRatio

Burke ratio of the return distribution
table.Arbitrary

wrapper function for combining arbitrary function list into a table
UpsidePotentialRatio

calculate Upside Potential Ratio of upside performance over downside risk
CAPM.beta

calculate single factor model (CAPM) beta
Return.read

Read returns data with different date formats
apply.fromstart

calculate a function over an expanding window always starting from the beginning of the series
table.SpecificRisk

Specific risk Summary: Statistics and Stylized Facts
chart.RollingCorrelation

chart rolling correlation fo multiple assets
BetaCoMoments

Functions to calculate systematic or beta co-moments of return series
TreynorRatio

calculate Treynor Ratio or modified Treynor Ratio of excess return over CAPM beta
Return.cumulative

calculate a compounded (geometric) cumulative return
MartinRatio

Martin ratio of the return distribution
SharpeRatio.annualized

calculate annualized Sharpe Ratio
chart.RollingQuantileRegression

A wrapper to create charts of relative regression performance through time
chart.TimeSeries

Creates a time series chart with some extensions.
clean.boudt

clean extreme observations in a time series to to provide more robust risk estimates
chart.RiskReturnScatter

scatter chart of returns vs risk for comparing multiple instruments
DRatio

d ratio of the return distribution
skewness

Skewness
chart.Histogram

histogram of returns
replaceTabs.inner

Display text information in a graphics plot.
chart.CumReturns

Cumulates and graphs a set of periodic returns
table.ProbOutPerformance

Outperformance Report of Asset vs Benchmark
MSquared

M squared of the return distribution
VolatilitySkewness

Volatility and variability of the return distribution
checkData

check input data type and format and coerce to the desired output type
edhec

EDHEC-Risk Hedge Fund Style Indices
MarketTiming

Market timing models
table.SFM

Single Factor Asset-Pricing Model Summary: Statistics and Stylized Facts
AverageLength

Calculates the average length (in periods) of the observed drawdowns.
CalmarRatio

calculate a Calmar or Sterling reward/risk ratio
table.DownsideRiskRatio

Downside Summary: Statistics and ratios
CAPM.jensenAlpha

Jensen's alpha of the return distribution
table.DownsideRisk

Downside Risk Summary: Statistics and Stylized Facts
chart.Events

Plots a time series with event dates aligned
SmoothingIndex

calculate Normalized Getmansky Smoothing Index
InformationRatio

InformationRatio = ActivePremium/TrackingError
chart.BarVaR

Periodic returns in a bar chart with risk metric overlay
charts.PerformanceSummary

Create combined wealth index, period performance, and drawdown chart
Return.calculate

calculate simple or compound returns from prices
AverageRecovery

Calculates the average length (in periods) of the observed recovery period.
M2Sortino

M squared for Sortino of the return distribution
CAPM.dynamic

Time-varying conditional single factor model beta
table.Autocorrelation

table for calculating the first six autocorrelation coefficients and significance
Return.annualized

calculate an annualized return for comparing instruments with different length history
PainIndex

Pain index of the return distribution
lpm

calculate a lower partial moment for a time series
DownsideDeviation

downside risk (deviation, variance) of the return distribution
TrackingError

Calculate Tracking Error of returns against a benchmark
ProspectRatio

Prospect ratio of the return distribution
Return.centered

calculate centered Returns
FamaBeta

Fama beta of the return distribution
Return.relative

calculate the relative return of one asset to another
PerformanceAnalytics-package

Econometric tools for performance and risk analysis.
maxDrawdown

caclulate the maximum drawdown from peak equity
table.DrawdownsRatio

Drawdowns Summary: Statistics and ratios
CAPM.alpha

calculate single factor model (CAPM) alpha
AppraisalRatio

Appraisal ratio of the return distribution
Frequency

Frequency of the return distribution
PainRatio

Pain ratio of the return distribution
table.HigherMoments

Higher Moments Summary: Statistics and Stylized Facts
CAPM.CML.slope

utility functions for single factor (CAPM) CML, SML, and RiskPremium
chart.QQPlot

Plot a QQ chart
Kappa

Kappa of the return distribution
charts.RollingPerformance

rolling performance chart
TotalRisk

Total risk of the return distribution
SpecificRisk

Specific risk of the return distribution
SharpeRatio

calculate a traditional or modified Sharpe Ratio of Return over StdDev or VaR or ES
StdDev.annualized

calculate a multiperiod or annualized Standard Deviation
StdDev

calculates Standard Deviation for univariate and multivariate series, also calculates component contribution to standard deviation of a portfolio
ETL

calculates Expected Shortfall(ES) (or Conditional Value-at-Risk(CVaR) for univariate and component, using a variety of analytical methods.
MeanAbsoluteDeviation

Mean absolute deviation of the return distribution
Return.annualized.excess

calculates an annualized excess return for comparing instruments with different length history
UpDownRatios

calculate metrics on up and down markets for the benchmark asset
Modigliani

Modigliani-Modigliani measure
AdjustedSharpeRatio

Adjusted Sharpe ratio of the return distribution
SkewnessKurtosisRatio

Skewness-Kurtosis ratio of the return distribution
UpsideFrequency

upside frequency of the return distribution
Omega

calculate Omega for a return series
SystematicRisk

Systematic risk of the return distribution
chart.RelativePerformance

relative performance chart between multiple return series
apply.rolling

calculate a function over a rolling window
table.Stats

Returns Summary: Statistics and Stylized Facts
chart.ACF

Create ACF chart or ACF with PACF two-panel chart
table.Variability

Variability Summary: Statistics and Stylized Facts
zerofill

zerofill
chart.VaRSensitivity

show the sensitivity of Value-at-Risk or Expected Shortfall estimates
Return.clean

clean returns in a time series to to provide more robust risk estimates
Return.excess

Calculates the returns of an asset in excess of the given risk free rate
AverageDrawdown

Calculates the average depth of the observed drawdowns.
weights

Selected Portfolio Weights Data
VaR

calculate various Value at Risk (VaR) measures
UpsideRisk

upside risk, variance and potential of the return distribution
chart.SnailTrail

chart risk versus return over rolling time periods
DrawdownPeak

Drawdawn peak of the return distribution
table.CaptureRatios

Calculate and display a table of capture ratio and related statistics
table.TrailingPeriods

Rolling Periods Summary: Statistics and Stylized Facts
table.Distributions

Distributions Summary: Statistics and Stylized Facts
chart.Regression

Takes a set of returns and relates them to a market benchmark in a scatterplot
managers

Hypothetical Alternative Asset Manager and Benchmark Data
KellyRatio

calculate Kelly criterion ratio (leverage or bet size) for a strategy
chart.Drawdown

Time series chart of drawdowns through time
table.Correlation

calculate correlalations of multicolumn data
chart.Bar

wrapper for barchart of returns
chart.RollingPerformance

wrapper to create a chart of rolling performance metrics in a line chart
chart.CaptureRatios

Chart of Capture Ratios against a benchmark
portfolio_bacon

Bacon(2008) Data
chart.RollingMean

chart the rolling mean return
chart.Scatter

wrapper to draw scatter plot with sensible defaults
legend

internal functions for setting useful defaults for graphs
findDrawdowns

Find the drawdowns and drawdown levels in a timeseries.
table.Drawdowns

Worst Drawdowns Summary: Statistics and Stylized Facts
sortDrawdowns

order list of drawdowns from worst to best
mean.geometric

calculate attributes relative to the mean of the observation series given, including geometric, stderr, LCL and UCL
table.InformationRatio

Information ratio Summary: Statistics and Stylized Facts
chart.ECDF

Create an ECDF overlaid with a Normal CDF
table.CalendarReturns

Monthly and Calendar year Return table
BernardoLedoitRatio

Bernardo and Ledoit ratio of the return distribution
CoMoments

Functions for calculating comoments of financial time series
UlcerIndex

calculate the Ulcer Index
chart.Boxplot

box whiskers plot wrapper
chart.StackedBar

create a stacked bar plot
prices

Selected Price Series Example Data
table.AnnualizedReturns

Annualized Returns Summary: Statistics and Stylized Facts