The major functional changes in v2.1.0 include expanded risk and portfolio estimation capabilities, plotting enhancements, and comprehensive test coverage expansions.
This release adds Generalized Pareto Distribution (gpd), Lognormal
(lognormal), and Monte Carlo (montecarlo) estimation methods to VaR and ES,
incorporating functionality from the archived VaR package by Talgat Daniyarov.
Additionally, VaR.backtest has been added for evaluating VaR estimates using
the Kupiec Proportion of Failures test.
In portfolio functionality, we have added proportional transaction cost
support (rebal_cost) during rebalancing events in Return.portfolio, which
supports both scalar and vector inputs. table.CalendarReturns has also been
updated to seamlessly accept and aggregate daily returns. We added
sample_method = c("unbiased", "ML") to StdDev to support Population
(Maximum Likelihood) standard deviation estimates over complete manager tracks.
For graphics, base R charting functions (e.g., chart.Correlation,
charts.PerformanceSummary, chart.Histogram) now return S3 recordedplot
objects invisibly. This allows users to assign them to variables and replay
the graphics safely on demand.
Several bug fixes and documentation updates were included in this release:
- Standardized
SharpeRatioto strictly default to arithmeticgeometric = FALSEto align with the canonical 1994 definition, and deprecated the redundantSharpeRatio.annualizedfunction in favor of a unified wrapper. - Re-aligned standard error evaluations in parametric
VaR/ESroutines; GPD methods accurately return Profile Log-Likelihood confidence bounds (LCL/UCL) instead of attempting to mimic influence-functionRPESEstandard errors. - Fixed closures and dimensionality mapping errors in
CDaR.alphaandReturn.excesswhen handling multivariate combinations without names. - Addressed edge cases in
Return.portfoliorelated to zero or near-zero weights, and clarified documentation on the behavior of rebalancing and transaction cost application in such scenarios.
Test coverage has been significantly expanded to ~86%, adding over a
thousand testthat assertions hitting plotting engines (ggplot2/plotly),
multi-frequency scaling arrays (table.AnnualizedReturns), mathematical
coercions (Return.convert), and moment optimizations (MM.NCE).
The push for test coverage was driven by a desire to work through the backlog of github issues and pull requests that accumulates over time with a package as widely used as PerformanceAnalytics, and to ensure that the new functionality doesn't break historical functionality and backwards compatibility. We are grateful to all contributors who have helped with testing, bug fixes, and documentation improvements.
The test writing and coverage work was predominantly completed by making
heavy use of testthat tests proposed and written utilizing LLM assistance
with Google Gemini 3.1 Pro agent integration in Gemini CLI and Zed. We
are excited about the potential for LLMs to assist with testing and
maintenance of open source software, and this release is a significant
milestone in that journey. While LLM's approach the process of writing
tests very differently than a traditional human unit testing methodology,
more complete test coverage inevitably uncovers issues that need addressing,
even if most of these were thankfully edge cases and lesser used protection
paths. We didn't let the LLM push code, and all code changes were reviewed
and approved by Brian Peterson, but the code coverage and backlog reduction
wouldn't have happened without the quasi-background assistance of the LLM.
We thank Google and their Cloud team for their support of open source software development and projects.
... and the usual minor things that get changed and updated in the general course of maintenance.
As always, especially now in our ever more automated world, any blame should be directed at Brian Peterson.
The major functional changes in v 2.0.0-2.0.2 are the addition of standard errors and additional plotting engines.
This release adds support for plotting engines dygraphs, plotly,
gridExtra, ggplot2, and googleVis to all charting functions that
are able to support those engines via the use of a new plot.engine
argument. This work was predominantly completed by Ziheng 'Zenith'
Zhou and Justin Shea as part of Google Summer of Code 2019.
This functionality is working, but consider it experimental for now, it may
change in the future as we receive feedback and patches from users.
This release additionally adds support for multiple methods of
standard error calculations derived from the robust statistics
work of R. Douglas Martin. The code was primarily written by
Anthony-Alexander Cristidis during Google Summer of Code 2018 and following,
and is mostly included by reference to packages RobStatTM and
RPESE if the user desires to utilize the standard errors functionality.
changed test infrastructure to tinytest from testthat after unreproducible
traceback results on only some Windows platforms in testthat.
Note that some examples are disabled on Windows because of runtime issues with the Rtools4 'experimental' toolchain. Users may still run this code, of course.
... and the usual minor things that get changed and updated in the general course of maintenance.
The major functional change in v1.5 is in the higher moment code. Dries Cornilly of Belgium contributed sparse matrix code in GSoC 2017 to make calculation of higher moments and comonments much faster and more robust.
Additionally, PerformanceAnalytics has been updated to use the new plot.xts,
which should signficiantly decrease the amount of maintenance required, and
increase the flexibility in plotting. Thanks to Eric Hung for that GSoC work.
PerformanceAnalytics moved to github in 2016 after the release of v1.4 https://github.com/braverock/PerformanceAnalytics
Most of the commits leading up to release are the result of continued tightening and drift in CRAN standards, most should not have user-visible results.
... and the usual minor things that get changed and updated in the general course of maintenance.
We've completely re-written Return.portfolio to make more of the
internals available for those who have the need to disassemble the
various components of the portfolio return. Return.portfolio and
Return.rebalancing are now the same function, with Return.portfolio
being preferred for new code.
This release also adds some functionality from Bacon, and makes visible some functions that were previously internal to the package.
We've moved to using roxygen2 to generate the NAMESPACE file,
which required touching basically every single generated .Rd file.
We're also altering our version numbering system. We'll be using a "major.cran-release.r-forge-rev" form to make it easier for us to track where reported issues may have been introduced. Major releases will continue to indicate that significant changes to the interfaces of the functions were made. This is our 4th CRAN release after 1.0, so the minor number moves to 4. The trailing number will reflect the revision number from R-Forge's svn associated with the tagged CRAN (or subsequent) release.
Most of the commits leading up to release are the result of continued tightening and drift in CRAN standards, most should not have user-visible results.
... and the usual minor things that get changed and updated in the general course of maintenance.
Another release almost exclusively based on R core changes ahead of R 3.0.0.
Most of the commits leading up to release are the result of continued tightening and drift in CRAN standards, most should not have user-visible results.
... and the usual minor things that get changed and updated in the general course of maintenance.
(sent to CRAN 2012-03-29)
This release is aimed almost exclusively at support for
multiple changes made to deal with R core changes, especially in
the areas of multi-column support for sd and mean.
User functionality should be unchanged.
... and the usual minor things that get changed and updated in the general course of maintenance.
PerformanceAnalytics roxygen note (2011-10-02):
We're converting the documentation to use roxygen2. If you find any errors or
omissions from previous documentation, please notify us.
We will shift to roxygen documentation with package v1.1
A change to the behavior of as.xts removed functionality relied on by
PerformanceAnalytics in checkData. Thanks to debugging help from
Jeff Ryan and a one-line patch, everything should work as expected
back through current and older xts versions.
... and the usual minor things that get changed and updated in the general course of maintenance.
(sent to CRAN 2010-08-04)
This is an incremental bugfix and improvement release on the v1.0.x cycle.
We would like to acknowledge feedback and suggestions from Giuseppe Milicia and Murali Menon which have resulted in changes or improvements to several functions in this release, mostly to eliminate problems with edge cases or specific failure modes.
Style functions have been removed in this release and moved to the new project FactorAnalytics with Eric Zivot on R-Forge.
... and the usual minor things that get changed and updated in the general course of maintenance.
(released to CRAN 2010-04-08)
This release is an incremental improvement on v1.0.x
We've continued to make functions more friendly for use in parallel execution and optimization environments.
Several bugfixes have been applied to edge case problems, details are in the full ChangeLog provided with the package.
We've added several new ways of calling functions that can take moments rather than returns to allow for more robust or other improved methods of calculating moments.
Added patches to graphics provided by Dominik Locher.
... and the usual minor things that get changed and updated in the general course of maintenance.
(tagged 2010-01-07, not released to CRAN)
This release is predominantly a minor bugfix release.
We've reduced the number of warning() calls throughout the code to better
allow for execution in a highly parallel environment.
We've fixed bugs related to assuming compounding/geometric returns in all functions that could be affected by such assumptions.
Bugs related to handling matrices pointed out by Dr. Stefan Albrecht have been removed.
... and the usual minor things that get changed and updated in the general course of maintenance.
(released to CRAN 2009-10-27)
This release marks a major milestone for PerformanceAnalytics. After several years and acquiring users worldwide, we feel things are stable enough to mark this release 1.0.0. Hopefully this will decrease the number of changes made to the interfaces and functionality of the package in the future, and let us work on other things.
Probably the most new functionality in this release has gone into VaR, ES and
modified VaR and ES. Thanks to some excellent code and research contributions
from Kris Boudt of K.U. Leuven, we've added substantially to the capabilities in
this release. The new VaR and ES functions allow a wide variety of methods
for calculation, and even methods for calculating risk contribution given
portfolio weights. This is great stuff, and we're deeply greatful for Kris'
contribution.
During the past year, we've modified almost every function in the package.
There were two things we wanted to accomplish: move to xts for time series
functions internally, and improve the speed and convenience of the functions.
The move to xts has improved the package immensely. Not only have the time axes
of the graphics improved, but calculations and charts now handle different data
periodicities automatically. Calculations are noticably faster, too.
Users of fPortfolio and other Rmetrics packages can use timeSeries objects with
PA functions seamlessly. Thanks to the xts reclass function, if you input a
timeSeries object into a PA function that calculates a time series result (such
as Drawdowns), that result is delivered as a timeSeries classed object.
All of the functions in PA now support multi-column returns objects. Drop a data set in, and the calculations are done for each column. For example:
> data(managers)
> `SharpeRatio`.annualized(managers[,1:8])
HAM1 HAM2 HAM3 HAM4 HAM5 HAM6 EDHEC.LS.EQ SP500.TR
1.6033616 1.3240442 1.1488361 0.6169326 0.1933374 1.8380958 1.6414220 0.6448502
In any re-write like this, there's good news and bad news. The bad news is that
there have been changes to parameter names along the way. The most substantial
of these is anywhere we used 'rf' for the risk free rate, we now use Rf. We've
made the changes to be more consistent and make the code easier to maintain, and
we appreciate your patience.
(released to CRAN 2008-10-12)
This release adds 39 new public functions, an example dataset,
and utilizes R's namespace capability. We have also decreased the number
of "Requires" packages to just zoo, moving the rest to "Suggests" and
loading them only when needed, with a warning or error (as appropriate) if
they are not available. This should lower both loading time and the memory
footprint of using PerformanceAnalytics.
Risk functionality
We have extended the risk metrics provided by
PerformanceAnalytics to include multivariate portfolio measures
of Gaussian and Cornish fisher VaR and Expected Shortfall.
Functions:
GES.MMGVaR.MMmES.MMmVaR.MM
Modified Sharpe Ratios
Earlier versions of PerformanceAnalytics contained the modified
Sharpe Ratio based on the Cornish fisher expansion. we have
added additional modified Sharpe ratios to calculate portfolio
ratios for both Gaussian and modified Cornish Fisher Var and
Expected Shortfall of the multivariate portfolio distribution.
Functions:
SR.GES.MMSR.GVaR.MMSR.mES.MMSR.mVaR.MMSR.StdDev.MM
TODO: need to wrap the SharpeRatio function to take a "method"
argument and return one or all.
Style Analysis
We are happy to announce that style analysis, long a goal of this
package, has made significant progress in this release, with the
addition of four new functions.
These functions calculate style weights using an asset class
style model as described in detail in Sharpe (1992). The use of
quadratic programming to determine a fund's exposures to the
changes in returns of major asset classes is usually referred to
as "style analysis".
Functions:
chart.RollingStylecalculates and displays those weights in rolling windows through time.chart.Stylecalculates and displays style weights calculated over a single period.style.fitmanages the calculation of the factor weights by methodstyle.QPfitcalculates the specific constraint case that requires quadratic programming
Charts
We've added three new graph functions in this release:
-
chart.VaRSensitivityCreates a chart of Value-at-Risk estimates by confidence interval for multiple methods. Possibly useful for comparing a calculated VaR method to the historical VaR. -
chart.SnailTrailA scatter chart that shows how rolling calculations of annualized return and annualized standard deviation have proceeded through time. The color of lines and dots on the chart diminishes with respect to time. May be helpful for showing the trend of the return/risk characteristics of the fund over time. -
chart.StackedBarThis creates a stacked column chart with time on the horizontal axis and values in categories. This kind of chart is commonly used for showing portfolioweightsthrough time, although the function will plot any values by category. This is a primitive function and is expected to improve.
Moments of a distribution
We have added several functions to calculate standardized moments
and multivariate moments of an asset or multivariate portfolio
distribution. When working with multivariate series, the joint
distribution of the returns is to be preferred over the simple
univariate distribution of the resulting return vector of a
portfolio. Once the multivariate moments are available, it is
possible to compute the comoments, comoment matrices, and beta or
systematic comoments.
`skewness`
`kurtosis`
`skewness.MM`
`kurtosis.MM`
We've ported and reimplemented skewness and kurtosis from
Rmetrics to allow for additional data classes as well as
multivariate series.
`StdDev.MM`
`multivariate_mean`
`Return.centered`
`M3.MM`
`M4.MM`
We've additionally implemented the multivariate moment
calculations for the first two portfolio moments (mean and
standard deviation) as well as the third and forth mathematical
moments.
`CoVariance`
`CoKurtosis`
`CoSkewness`
Calculates the covariance, coskewness. or cokurtosis of one asset
with relation to another (scalar measure) utilizing the
standardized central mathematical moments of the distribution.
`CoKurtosisMatrix`
`CoSkewnessMatrix`
Calculates the N x N2 co-moment matrix of assets to one another,
can be utilized in a portfolio context. This is a complete
reimplementation of the prior functions in PerformanceAnalytics
to calculate moments, and has been validated by our research work
as superior to the prior implementation.
`centeredmoment`
`centeredcomoment`
Used internally by PerformanceAnalytics to calculate centered
moments for a multivariate distribution as well as the
standardized moments of a portfolio distribution. They are
exposed here for users who wish to use them directly
`BetaCoVariance`
`BetaCoSkewness`
`BetaCoKurtosis`
Calculates the systematic or beta comoment of two assets or an
asset versus a portfolio. used to assess diversification
potential in a portfolio, or in multivariate multimoment
portfolio optimization.
Significant Changes to existing functions:
chart.BarVaR- Incorporates 'Return.clean' methods for using cleaning methods
when charting forecasted
VaRvalues. - Handles multiple columns OR multiple
VaRcalculation methods - Can show cleaned returns overlaid on original data
- Added horizontal line to show exceedences to most recent risk estimate
- Incorporates 'Return.clean' methods for using cleaning methods
when charting forecasted
Co-moments and Beta/Systematic Co-moments have been completely reimplemented, and are discussed above.