The Technical Corner

The Technical Corner

By Steve Craighead

Today, I am going to look at an extensive integrated collection of financial packages currently available in R.1 The collective name of these packages is RMetrics,2 which has been developed by Deitheim Würtz and his RMetrics Team at ETH Zurich. From my experience, I believe that these packages are one of the best publicly available financial mathematical modeling environments. Rmetrics currently is made up of nine separate R packages, with several more in planning. I could write a single column on each of these packages, but I only give a brief summary below:

fBasics: This package is to be used in the modeling of market return series. You will be able to model returns with the provided statistical distributions and the associated tools.

fCalendar: This package defines the chronological and calendar objects. Specifically the Time and Date class allows you to separately model over 100 different cities and/or regions worldwide by providing you access to the correct trading days in these markets.

fCopulae: This package allows you to use various bivariate copulas, such as Elliptical, Archimedean, Extreme Value and empirical.3

fEcofin: This package gives access to economic and financial data sets. Here you can dynamically access various stock, inflation and economic series from either the CIA Fact Book or WFE.4

fExtremes: This package has both data and tools to examine and model extreme values for financial series.5

fMultivar: This package is for multivariate market analysis. Tools are included so that you are able to do both Technical and Benchmark Analysis.

fOptions: This package is for option valuation. You are provided with tools to work with plain vanilla, basic American, Binomial Tree, Look Back, Barrier, Binary, Asian, Exponential and Brownian Motion Asian options. The package also implements the Heston–Nandi GARCH option model. It also has several low discrepancy models among which is an excellent high dimensional Scrambled Sobol sequence approach.6

fPortfolio: This package supplies the tools to conduct portfolio selection and optimization.

fSeries: This package allows you to model the dynamic processes underlying markets by conducting either ARMA, GARCH, Long Range (fractal) or non–linear time series analysis.

Personally, I have used both fBasics and fOptions, and I was especially surprised by the quality of results from the use of the Scrambled Sobol sequences in various scenario reduction problems.

The Rmetrics webpage Rmetrics.org is well designed and has a wealth of knowledge regarding the current nine packages and descriptions of future packages. The webpage also contains several white papers describing key underlying models.

Whether you teach or practice financial engineering, I think that you will find that this set of R packages and the supporting Rmetrics webpage to be invaluable.

  • 1R Development Core Team, "R: A Language and Environment for Statistical Computing Release 2.5.1." R–project.org. Vienna, Austria, 2007.
  • 2Würtz, Diethelm, "Rmetrics: An Environment for Teaching Financial Engineering and Computational Finance." Rmetrics.org. Zürich, Switzerland, 2004.
  • 3Note: The R copula package, which is not a part of Rmetrics, allows one to model copulas up to six dimensions.
  • 4World Federation of Stock Exchanges.
  • 5There are several different R packages that also model extreme value models.
  • 6See Itp.phys.ethz.ch for a copy of the white paper on these sequences.