O'Reilly logo

Financial Risk Modelling and Portfolio Optimization with R by Bernhard Pfaff

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix C

Back-testing and reporting of portfolio strategies

C.1 R packages for back-testing

The following packages provide either functions or class/method definitions for conducting portfolio back-tests and analysing the results thereof. It should be noted that the results of these back-tests might fall short of the user’s requirements and so might be amended by further statistics and figures, for instance, by employing the facilities available in the package PerformanceAnalytics (see Carl et al. 2012). Possibilities for generating tailor-made reports will be introduced in the next section.

The package stockPortfolio (see Diez and Christou 2012) is dedicated solely to stock portfolio analysis and provides routines for data retrieval from Yahoo!, portfolio optimization and carrying out a back-test for a given strategy. The latter is implemented as function testPort(). The package is hosted on CRAN.

In the package backtest (see Enos et al. 2010) an S4 class backtest is defined with associated methods for exploring portfolio-based conjectures about the assets included. This class definition is not confined to assets belonging to a certain class, but the constituent financial instruments can be stocks, bonds, swaps, options, currencies, etc. Objects of this class can be generated with the function backtest(). The package is hosted on CRAN.

Finally, the package fPortfolioBacktest (see Würtz et al. 2010) is hosted on R-Forge only. Similar to backtest, an S4 class fPFOLIOBACKTEST ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required