Learn R Programming

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

PerformanceAnalytics (version 1.0.2.1)

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

41,286

Version

1.0.2.1

License

GPL

Maintainer

Brian G Peterson

Last Published

April 25th, 2010

Functions in PerformanceAnalytics (1.0.2.1)

CAPM.beta

calculate CAPM beta
chart.Histogram

histogram of returns
Return.calculate

calculate simple or compound returns from prices
chart.SnailTrail

chart risk versus return over rolling time periods
chart.Style

calculate and display effective style weights
chart.Correlation

correlation matrix chart
charts.PerformanceSummary

Create combined wealth index, period performance, and drawdown chart
clean.boudt

clean extreme observations in a time series to to provide more robust risk estimates
apply.rolling

calculate a function over a rolling window
sortDrawdowns

order list of drawdowns from worst to best
CAPM.utils

utility functions for CAPM CML, SML, and RiskPremium
maxDrawdown

caclulate the maximum drawdown from peak equity
findDrawdowns

Find the drawdowns and drawdown levels in a timeseries.
managers

Hypothetical Alternative Asset Manager and Benchmark Data
SharpeRatio

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

calculate a function over an expanding window always starting from the beginning of the series
CalmarRatio

calculate a Calmar or Sterling reward/risk ratio
VaR

calculate various Value at Risk (VaR) measures
PerformanceAnalytics-package

Econometric tools for performance and risk analysis.
table.HigherMoments

Higher Moments Summary: Statistics and Stylized Facts
CDD

Calculate Uryasev's proposed Conditional Drawdown at Risk (CDD or CDaR) measure
Return.annualized

calculate an annualized return for comparing instruments with different length history
PerformanceAnalytics-internal

internal functions for setting useful defaults for graphs
KellyRatio

calculate Kelly criterion ratio (leverage or bet size) for a strategy
SharpeRatio.annualized

calculate annualized Sharpe Ratio
ES

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

create a stacked bar plot
UpsidePotentialRatio

calculate Upside Potential Ratio of upside performance over downside risk
zerofill

zerofill
chart.RollingRegression

A wrapper to create charts of relative regression performance through time
ActivePremium

Active Premium
CAPM.alpha

calculate CAPM alpha
Beta Co-Moments

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

InformationRatio = ActivePremium/TrackingError
mean.utils

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

calculate Geltner liquidity-adjusted return series
chart.RollingCorrelation

chart rolling correlation fo multiple assets
table.Drawdowns

Worst Drawdowns Summary: Statistics and Stylized Facts
Omega

calculate Omega for a return series
Return.excess

Calculates the returns of an asset in excess of the given risk free rate
table.CaptureRatios

Calculate and display a table of capture ratio and related statistics
Return.read

Read returns data with different date formats
chart.RelativePerformance

relative performance chart between multiple return series
Co-Moments

Functions for calculating comoments of financial time series
chart.Scatter

wrapper to draw scatter plot with sensible defaults
UpDownRatios

calculate metrics on up and down markets for the benchmark asset
chart.ACF

Create ACF chart or ACF with PACF two-panel chart
chart.Regression

Takes a set of returns and relates them to a market benchmark in a scatterplot
Return.clean

clean returns in a time series to to provide more robust risk estimates
chart.TimeSeries

Creates a time series chart with some extensions.
Return.cumulative

calculate a compounded (geometric) cumulative return
TreynorRatio

calculate Treynor Ratio of excess return over CAPM beta
prices

Selected Price Series Example Data
chart.BarVaR

Periodic returns in a bar chart with risk metric overlay
Return.relative

calculate the relative return of one asset to another
sd.multiperiod

calculate a multiperiod or annualized Standard Deviation
chart.Bar

wrapper for barchart of returns
table.AnnualizedReturns

Annualized Returns Summary: Statistics and Stylized Facts
SortinoRatio

calculate Sortino Ratio of performance over downside risk
Return.centered

calculate centered Returns
DownsideDeviation

downside risk (deviation, variance) of the return distribution
chart.RiskReturnScatter

scatter chart of returns vs risk for comparing multiple instruments
chart.RollingMean

chart the rolling mean return
chart.Events

Plots a time series with event dates aligned
charts.RollingPerformance

rolling performance chart
skewness

Skewness
chart.QQPlot

Plot a QQ chart
chart.ECDF

Create an ECDF overlaid with a Normal CDF
Return.portfolio

Calculates weighted returns for a portfolio of assets
table.Arbitrary

wrapper function for combining arbitrary function list into a table
chart.Boxplot

box whiskers plot wrapper
table.TrailingPeriods

Rolling Periods Summary: Statistics and Stylized Facts
StdDev

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

Chart of Capture Ratios against a benchmark
table.Correlation

calculate correlalations of multicolumn data
chart.Drawdown

Time series chart of drawdowns through time
TrackingError

Calculate Tracking Error of returns against a benchmark
chart.VaRSensitivity

show the sensitivity of Value-at-Risk or Expected Shortfall estimates
kurtosis

Kurtosis
chart.RollingPerformance

wrapper to create a chart of rolling performance metrics in a line chart
edhec

EDHEC-Risk Hedge Fund Style Indices
SmoothingIndex

calculate Normalized Getmansky Smoothing Index
table.Stats

Returns Summary: Statistics and Stylized Facts
table.CalendarReturns

Monthly and Calendar year Return table
chart.CumReturns

Cumulates and graphs a set of periodic returns
textplot

Display text information in a graphics plot.
table.DownsideRisk

Downside Risk Summary: Statistics and Stylized Facts
weights

Selected Portfolio Weights Data
checkData

check input data type and format and coerce to the desired output type
table.Autocorrelation

table for calculating the first six autocorrelation coefficients and significance
table.CAPM

Asset-Pricing Model Summary: Statistics and Stylized Facts