CRAN Task View: Empirical Finance
|Contact:||Dirk.Eddelbuettel at R-project.org|
This CRAN Task View contains a list of packages useful for
empirical work in Finance, grouped by topic.
Besides these packages, a very wide variety of functions suitable for
empirical work in Finance is provided by both the basic R
system (and its set of recommended core packages), and a number of
other packages on the Comprehensive R Archive Network (CRAN).
Consequently, several of the other CRAN Task Views may contain suitable
packages, in particular the
Contributions are always welcome, and encouraged. Since the start of
this CRAN task view in April 2005, most contributions have arrived as
email suggestions. The source file for this particular task view file
now also reside in a GitHub repository (see below) so that pull
requests are also possible.
Standard regression models
A detailed overview of the available regression methodologies is
provided by the
task view. This is
complemented by the
which focuses on more robust
and resistant methods.
Linear models such as ordinary least squares (OLS) can be estimated
(from by the stats package contained in the basic R
distribution). Maximum Likelihood (ML) estimation can be undertaken
with the standard
function. Many other suitable methods
are listed in the
view. Non-linear least squares can
be estimated with the
function, as well as with
For the linear model, a variety of regression diagnostic tests
are provided by the
packages provide user
interfaces that may be of interest as well.
A detailed overview of tools for time series analysis can be found in
task view. Below a brief overview of the
most important methods in finance is given.
Classical time series functionality is provided
commands in the
basic R distribution.
packages provide a variety of more
advanced estimation methods;
estimate fractionally integrated series;
related material. The
provide fractal time series modeling
For volatility modeling, the standard GARCH(1,1) model can
be estimated with the
function in the
package. Rmetrics (see below) contains
package which has additional models.
package can be used to model a
variety of univariate GARCH models with extensions such as
ARFIMA, in-mean, external regressors and various other
specifications; with methods for fit, forecast, simulation,
inference and plotting are provided too. The
builds on it to provide the ability to estimate several multivariate
GARCH models. The
package can estimate and simulate the
Beta-t-EGARCH model by Harvey. The
package can perform Bayesian estimation of a GARCH(1,1)
model with Student's t innovations. For multivariate
package can estimate
(multivariate) Conditional Correlation GARCH models whereas
package provides functions for
generalized orthogonal GARCH models. The
package (which was preceded by a related package
AutoSEARCH) provides automated general-to-specific model selection of the mean and
log-volatility of a log-ARCH-X model. The
package can fit ARMA-GARCH or ARMA-APARCH models with GEV and
stable conditional distributions. The
can estimate and fit log-Garch models.
Unit root and cointegration tests are provided by
The Rmetrics packages
contain a number of estimation functions for
ARMA, GARCH, long memory models, unit roots and more.
package implements the Hansen unit root test.
Bayesian estimation of vector autoregressive models. The
Bayesian and likelihood analysis of dynamic linear models (ie
linear Gaussian state space models).
package offer estimation, diagnostics,
forecasting and error decomposition of VAR and SVAR model in a
are suitable for dynamic (linear) regression
Several packages provide wavelet analysis
wavethresh. Some methods from chaos
theory are provided by the package
adds time series analysis based on dynamical systems therory.
package adds functions for
package provides functions for time series factor analysis.
package implements Bayesian
estimation of stochastic volatility using Markov Chain Monte
The Rmetrics suite of packages comprises
and contains a very large number of relevant functions for different aspect of empirical
and computational finance.
package provides several option-pricing
functions as well as some fixed-income functionality from the
QuantLib project to R.
package offers a number of functions for
quantitative modelling in finance as well as data acqusition, plotting
and other utilities.
classes for equity portfolio management; the
builds a related simulation framework.
offers tools to
explore portfolio-based hypotheses about financial instruments.
package provides functions for
single index, constant correlation and multigroup models.
package offers performance attribution
functionality for equity portfolios.
package contains a large number
of functions for portfolio performance calculations and risk management.
contains functions to construct technical
trading rules in R.
package can compute present values, cash
flows and other simple finance calculations.
package provides simulation and inference functionality
for stochastic differential equations.
packages contain methods for the estimation
of zero-coupon yield curves and spread curves based the parametric
Nelson and Siegel (1987) method with the Svensson (1994)
extension. The former package adds the McCulloch (1975) cubic
splines approach, the latter package adds the Diebold and Li approach.
construct the yield curve using
the Smith-Wilson approach based on LIBOR and SWAP rates.
package contains a number of variance ratio
tests for the weak-form of the efficient markets hypothesis.
package provides generalized method of moments
(GMM) estimations function that are often used when estimating the
parameters of the moment conditions implied by an asset pricing
package contains estimator based on random
matrix theory as well as shrinkage methods to remove sampling noise
when estimating sample covariance matrices.
package by contains material to
accompany the Iacus (2011) book entitled "Option Pricing and
Estimation of Financial Models in R".
package provides a market simulator,
initially designed around the bond market.
package has a collection of
function for Finance including the estimation of covariance
package contains a pricer for
different American call options.
package can price a variance swap
via a portfolio of European options contracts.
package implements the Lee and Ready (1991)
and Easley and O'Hara (1987) tests for, respectively, trade direction,
and probability of informed trading.
package provides support for portfolio
allocation and risk management applications.
package provides a
rivatives and contains numerous pricer examples as
well as interactive 2d and 3d plots to study these pricing
package contains a collection of tools
for analyzing significance of trading strategies, based on the
Sharpe ratio and overfit of the same.
package implements various functions to extract risk-neutral densities
from option prices.
can price American Options via the Least Squares Monte Carlo
seven statistical tests and support functions for determining if numerical data
could conform to Benford's law.
package values call and put option portfolio and implements an
optimal hedging strategy.
package provides functionality to
easily handle and analyse discrete Markov chains.
package models yield curve interpolation and extrapolation using
via the Nelson-Siegel, Svensson, or Smith-Wilson models, as well as Hermite cubic splines.
package models provides functions for time
value of money such as cashflows and yield curves.
package provides functions to test
the statistical signicance of Markowitz portfolios.
package implements the Engle-Granger
two-stage cointegration modeling procedure with a particular
focus on pairs trading.
package models the probability of backtest
overfitting, performance degradation, probability of loss, and the
stochastic dominance when analysing trading strategies.
efficient Monte Carlo algorithms for the price and the sensitivities
of Asian and European Options under Geometric Brownian Motion.
package implements a structural
estimator to correct for the bias arising from endogenous matching
(e.g. group formation in microfinance or matching of firms and
package interfaces the API at
www.estimize.com which provides crowd-sourced earnings estimates.
Several packages provide functionality for
Extreme Value Theory models:
provide function for modelling credit risks.
package provides code for multivariate Normal and t-distributions.
The Rmetrics packages
also contain a number of relevant functions.
multivariate dependency structures using copula methods.
package provides an actuarial
perspective to risk management.
package provides generalized hyberbolic distribution
functions as well as procedures for VaR, CVaR or target-return
package provides functions for modeling
insurance claim reserves; and the
provides functions for financial and actuarial evaluations of life contingencies.
package aims to collect functions for Financial Risk Management and Quantitative Analysis.
package can be used to model for asset projection, a scenario-based simulation approach.
package provides efficient simulation
procedures to estimate tail loss probabilities and conditional
excess for a stock portfolios where log-returns are assumed to
follow a t-copula model with generalized hyperbolic or t marginals.
package anlyzes the default risk of credit
portfolio using both analytical and simulation approaches.
package provides a family of four
distributions tailored to distribution with symmetric and asymmetric
package provides an R companion to Tsay (2005),
Analysis of Financial Time Series
, 2nd ed. Wiley,
and includes data sets, functions and script files to work some
of the examples.
package provides functions, examples and data
Numerical Methods in Finance
by Manfred Gilli, Dietmar Maringer and
Enrico Schumann (2011), including the different optimization heuristics such as
Differential Evolution, Genetic Algorithms, Particle Swarms, and Threshold Accepting.
Data and date management
(part of Rmetrics) packages provide support for
irregularly-spaced time series. The
specifically for financial time series. See the
task view for more details.
calendar issues such as recurring holidays for a large number of
financial centers, and provides code for high-frequency data sets.
package can access Fame time series databases (but
also requires a Fame backend). The
time indices and time-indexed series compatible with Fame
package provides a unifying interface for
several time series data base backends, and its SQL implementations
provide a database table design.
package provides access to the Interactive Brokers
API for data access (but requires an account to access the service).
package provides very efficient and fast
access to in-memory data sets such as asset prices.
package provides an interface to the TrueFX (TM)
service for free streaming real-time and historical
tick-by-tick market data for interbank foreign exchange
rates at the millisecond resolution.
to manage, clean and match highfrequency trades and quotes
data and enables users to calculate various liquidity
measures, estimate and forecast volatility, and investigate
microstructure noise and intraday periodicity.
package offers access to Bitcoin
exchange APIs (mtgox, bitstamp, btce, kraken) via public and
private API calls and integration of data structures for all
package compute business days if
provided a list of holidays.
package manages tick-by-tick (equity)
transaction data performing 'cleaning', 'aggregation' and
'import' where cleaning and aggregation are performed
according to Brownlees and Gallo (2006).