Movatterモバイル変換
[0]ホーム
CRAN Task View: Empirical Finance
| Maintainer: | Dirk Eddelbuettel |
| Contact: | Dirk.Eddelbuettel at R-project.org |
| Version: | 2025-11-07 |
| URL: | https://CRAN.R-project.org/view=Finance |
| Source: | https://github.com/cran-task-views/Finance/ |
| Contributions: | Suggestions and improvements for this task view are very welcome and can be made through issues or pull requests on GitHub or via e-mail to the maintainer address. For further details see theContributing guide. |
| Citation: | Dirk Eddelbuettel (2025). CRAN Task View: Empirical Finance. Version 2025-11-07. URL https://CRAN.R-project.org/view=Finance. |
| Installation: | The packages from this task view can be installed automatically using thectv package. For example,ctv::install.views("Finance", coreOnly = TRUE) installs all the core packages orctv::update.views("Finance") installs all packages that are not yet installed and up-to-date. See theCRAN Task View Initiative for more details. |
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 theComprehensive R Archive Network (CRAN). Consequently, several of the other CRAN Task Views may contain suitable packages, in particular theEconometrics,Optimization,Robust, andTimeSeries Task Views.
Thectv package supports these Task Views. Its functionsinstall.views andupdate.views allow, respectively, installation or update of packages from a given Task View; the optioncoreOnly can restrict operations to packages labeled ascore below.
Contributions are always welcome and encouraged, either viae-mail to the maintainer or by submitting an issue or pull request in the GitHub repository linked above. See theContributing page in theCRAN Task Views repo for details.
Standard regression models
- A detailed overview of the available regression methodologies is provided by theEconometrics task view. This is complemented by theRobust task view, which focuses on more robust and resistant methods.
- Linear models such as ordinary least squares (OLS) can be estimated by
lm() (from by the stats package contained in the basic R distribution). Maximum Likelihood (ML) estimation can be undertaken with the standardoptim() function. Many other suitable methods are listed in theOptimization view. Non-linear least squares can be estimated with thenls() function, as well as withnlme() from thenlme package. - For the linear model, a variety of regression diagnostic tests are provided by thecar,lmtest,strucchange,urca, andsandwich packages. TheRcmdr package provide user interfaces that may be of interest as well.
Time series
- A detailed overview of tools for time series analysis can be found in theTimeSeries task view. Below a brief overview of the most important methods in finance is given.
- Classical time series functionality is provided by the
arima() andKalmanLike() commands in the basic R distribution. - Thetimsac package provides a variety of more advanced estimation methods;fracdiff can estimate fractionally integrated series;longmemo covers related material.
- For volatility modeling, the standard GARCH(1,1) model can be estimated with the
garch() function in thetseries package. Rmetrics (see below) contains thefGarch package which has additional models. Therugarch 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. Thermgarch builds on it to provide the ability to estimate several multivariate GARCH models. Thebetategarch package can estimate and simulate the Beta-t-EGARCH model by Harvey. ThebayesGARCH package can perform Bayesian estimation of a GARCH(1,1) model with Student’s t innovations. For multivariate models, thegogarch package provides functions for generalized orthogonal GARCH models. Thegets 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. Thelgarch package can estimate and fit log-GARCH models. Thegarchx package estimate GARCH models with leverage and external covariates. Thebmgarch package fits several multivariate GARCH models in a Bayesian setting. ThefEGarch package fits a variety of EGARCH models. - Unit root and cointegration tests are provided bytseries, andurca. The Rmetrics packagestimeSeries andfMultivar contain a number of estimation functions for ARMA, GARCH, long memory models, unit roots and more. TheCADFtest package implements the Hansen unit root test.
- Thevars package offer estimation, diagnostics, forecasting and error decomposition of VAR and SVAR model in a classical framework.
- Thedyn anddynlm packages are suitable for dynamic (linear) regression models.
- Several packages provide wavelet analysis functionality:wavelets,waveslim,wavethresh. Some methods from chaos theory are provided by the packagetseriesChaos.tsDyn adds time series analysis based on dynamical systems theory.
- Theforecast package adds functions for forecasting problems.
- Thestochvol package implements Bayesian estimation of stochastic volatility using Markov Chain Monte Carlo, andfactorstochvol extends this to the multivariate case.
- TheMSGARCH package adds methods to fit (by Maximum Likelihood or Bayesian), simulate, and forecast various Markov-Switching GARCH processes.
- TheDriftBurstHypothesis package estimates a t-test statistics for the explosive drift burst hypothesis (Christensen, Oomen and Reno, 2018).
- PackagelmForc various in-sample, out-of-sample, pseudo-out-of-sample and benchmark linear model forecast tests.
- TheRmfrac package provides tools for simulation of fractional and multifractional processes and related topics.
Finance
- The Rmetrics suite of packages comprisesfAssets,fBasics,fBonds,timeDate (formerly: fCalendar),fCopulae,fExtremes,fGarch,fImport,fNonlinear,fPortfolio,fRegression,timeSeries (formerly: fSeries),fTrading, and contains a very large number of relevant functions for different aspect of empirical and computational finance.
- TheRQuantLib package provides several option-pricing functions as well as some fixed-income functionality from the QuantLib project to R. TheRcppQuantuccia provides a smaller subset of QuantLib functionality as a header-only library; at current only some calendaring functionality is exposed.
- Thequantmod package offers a number of functions for quantitative modelling in finance as well as data acquisition, plotting and other utilities.
- Thebacktest offers tools to explore portfolio-based hypotheses about financial instruments. Thepa package offers performance attribution functionality for equity portfolios.
- ThePerformanceAnalytics package contains a large number of functions for portfolio performance calculations and risk management.
- TheTTR contains functions to construct technical trading rules in R.
- Thesde package provides simulation and inference functionality for stochastic differential equations.
- Thevrtest package contains a number of variance ratio tests for the weak-form of the efficient markets hypothesis.
- Thegmm 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 model.
- TheBurStFin andBurStMisc package has a collection of function for Finance including the estimation of covariance matrices.
- Theparma package provides support for portfolio allocation and risk management applications.
- TheSharpeR package contains a collection of tools for analyzing significance of trading strategies, based on the Sharpe ratio and overfit of the same.
- TheRND package implements various functions to extract risk-neutral densities from option prices.
- TheLSMonteCarlo package can price American Options via the Least Squares Monte Carlo method.
- TheBenfordTests package provides seven statistical tests and support functions for determining if numerical data could conform to Benford’s law.
- TheOptHedging package values call and put option portfolio and implements an optimal hedging strategy.
- Themarkovchain package provides functionality to easily handle and analyse discrete Markov chains.
- Thetvm package models provides functions for time value of money such as cashflows and yield curves.
- TheMarkowitzR package provides functions to test the statistical significance of Markowitz portfolios.
- Thepbo package models the probability of backtest overfitting, performance degradation, probability of loss, and the stochastic dominance when analysing trading strategies.
- TheOptionPricing package implements efficient Monte Carlo algorithms for the price and the sensitivities of Asian and European Options under Geometric Brownian Motion.
- Therestimizeapi package interfaces the API at www.estimize.com which provides crowd-sourced earnings estimates.
- Thecredule package is another pricer for credit default swaps.
- TheobAnalytics package analyses and visualizes information from events in limit order book data.
- Thederivmkts package adds a set of pricing and expository functions useful in teaching derivatives markets.
- TheInfoTrad packages estimates PIN and extends it to different factorization and estimation algorithms.
- TheFinancialMath package contains financial math and derivatives pricing functions as required by the actuarial exams by the Society of Actuaries and Casualty Actuarial Society ‘Financial Mathematics’ exam.
- Thetidyquant package re-arranges functionality from several other key packages for use in the so-called tidyverse.
- TheBCC1997 prices European options under the Bakshi, Cao anc Chen (1997) model for stochastic volatility, stochastic rates and random jumps.
- TheSim.DiffProc package provides functions to simulate and analyse multidimensional Itô and Stratonovitch stochastic calculus for continuous-time models.
- TheBLModel package computes the posterior distribution in a Black-Litterman model from a prior distribution given by asset returns and continuous distribution of views given by an external function.
- ThePortfolioOptim can solve both small and large sample portfolio optimization.
- TheDtD package computes thedistance to default per Merton’s model.
- ThePeerPerformance package analyzes performance of investments funds relative to its peers in a pairwise manner that is robust to false discoveries.
- ThecrseEventStudy package provides another event-study tool to analyse abnormal return in long-horizon events.
- Thesimfinapi package provides R access toSimFin fundamental financial statement data (given an API key).
- TheNFCP package models commodity prices via an n-factor term structure estimation.
- TheLSMRealOptions package uses least-squares Monte Carlo to value American and Real options.
- TheAssetCorr(archived) package estimates intra- and inter-cohort correlations from default data in a Vasicek credit portfolio model.
- Theichimoku package provides tools for creating and visualising Ichimoku Kinko Hyo strategies, and provides an interface to the OANDA fxTrade API for retrieving historical and live streaming price data (which requires free registration).
- Thegreeks package calculate sensitivities of financial option prices for European and Asian and American options in the Black Scholes model.
- TheRTL (Risk Tool Library) package offers a collection of functions and metadata to complement core packages in finance and commodities, including futures expiry tables.
- TheGARCHSK package estimates GARCHSK and GJRSK models allowing for time-varying volatility, skewness and kurtosis.
- Thebidask package offers a novel procedure to estimate bid-ask spreads from OHLC data, and implements other reference models.
- Thestrand package adds a framework for discrete (share-level) simulations of investment strategies.
- TheHDShOP package constructs shrinkage estimators of high-dimensional mean-variance portfolios and performs high-dimensional tests on optimality, and theDOSPortfolio package uses it to constructs dynamic optimal shrinkage estimators for the weights of the global minimum variance portfolio.
- TheSVDNF package implements a discrete nonlinear filter to find filtering distribution and maximum likelihood parameter estimates for stochastic volatility models with jumps.
- ThefHMM package implements hidden Markov models and their hierarchical extension for the detection and characterization of financial market regimes.
- Theepo package offers enhanced portfolio optimization (EPO) as described in Pedersen et al (2021).
- TheBayesianFactorZoo(archived) package provides a novel Bayesian framework for analysing linear asset pricing models as in Bryzgalova et al (2013).
- ThecryptoQuotes package provides a streamlined access to cryptocurrency OHLC-V market data and sentiment indicators with granularity varying from seconds to months.
Risk management
- The packagesqrmtools andqrmdata provide tools and data for standard tasks in Quantitative Risk Management (QRM) and accompany the book ofMcNeil, Frey, Embrechts (2005, 2015, “Quantitative Risk Management: Concepts, Techniques, Tools”).
- The Task ViewExtremeValue regroups a number of relevant packages.
- Themvtnorm package provides code for multivariate Normal and t-distributions.
- The packagenvmix provides functionality for multivariate normal variance mixtures (including normal and t for non-integer degrees of freedom).
- The Rmetrics packagesfPortfolio andfExtremes also contain a number of relevant functions.
- The packagescopula andcopulaData cover a wide range of modeling tasks for copulas.
- Theactuar package provides an actuarial perspective to risk management.
- Theghyp package provides generalized hyberbolic distribution functions as well as procedures for VaR, CVaR or target-return portfolio optimizations.
- TheChainLadder package provides functions for modeling insurance claim reserves; and thelifecontingencies package provides functions for financial and actuarial evaluations of life contingencies.
- TheESG package can be used to model for asset projection, a scenario-based simulation approach.
- TheriskSimul 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.
- TheGCPM package analyzes the default risk of credit portfolio using both analytical and simulation approaches.
- TheFatTailsR package provides a family of four distributions tailored to distribution with symmetric and asymmetric fat tails.
- TheDowd package contains functions ported from the ‘MMR2’ toolbox offered in Kevin Dowd’s book “Measuring Market Risk”.
- TheNetworkRiskMeasures package implements some risk measures for financial networks such as DebtRank, Impact Susceptibility, Impact Diffusion and Impact Fluidity.
- TheRisk package computes 26 financial risk measures for any continuous distribution.
- TheRiskPortfolios package constructs risk-based portfolios as per the corresponding papers by Ardia et al.
- ThereinsureR package models reinsurances a class Claims whose objective is to store claims and premiums, on which different treaties can be applied.
- TheRM2006 package estimates conditional covariance matrix using the RiskMetrics 2006 methodology described in Zumbach (2007).
- Thecvar package computes expected shortfall and value at risk for continuous distributions.
- riskParityPortfolio offers fast implementations for constructing risk-parity portfolios.
- Themonobin package performs monotonic binning of numeric risk factor in credit rating models (PD, LGD, EAD) development.
- Theetrm package contains a collection of functions to perform core tasks within energy trading and risk management (ETRM).
- PackageufRisk offers multiple Value at Risk and Expected Shortfall measures from both parametric and semiparametrics models.
- PackagesbondAnalyst andstockAnalyst provide a number of, respectively, bond pricing and fixed-income valuation functions and fundamental equity valuation function corresponding to standard industry practices for risk and return.
- PackagesbearishTrader,bullishTrader, andvolatilityTrader support trading strategies and analysis for, respectively, directional views or volatility regimes.
- PackageVaRES computes both value at risk and expected shortfall for many parametric distributions.
Books
- TheNMOF package provides functions, examples and data fromNumerical Methods and Optimization 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.
- TheFRAPO package provides data sets and code for the bookFinancial Risk Modelling and Portfolio Optimization with R by Bernhard Pfaff (2013).
Data and date management
- Thezoo andtimeDate (part of Rmetrics) packages provide support for irregularly-spaced time series. Thexts package extendszoo specifically for financial time series. See theTimeSeries task view for more details.
- timeDate also addresses calendar issues such as recurring holidays for a large number of financial centers, and provides code for high-frequency data sets.
- Thetis package provides time indices and time-indexed series compatible with Fame frequencies.
- PackagesIBrokers andrib provide access to the Interactive Brokers API (but require an account to access the service).
- Thedata.table package provides very efficient and fast access to in-memory data sets such as asset prices.
- The packagehighfrequency contains functionality 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.
- Thebizdays package compute business days if provided a list of holidays.
- TheTAQMNGR 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).
- TheRblpapi package offers efficient access to the Bloomberg API and allows
bdp,bdh, andbds queries as well as data retrieval both in (regular time-)bars and ticks (albeit without subsecond resolution). - TheGetTDData package imports Brazilian government bonds data (such as LTN, NTN-B and LFT ) from the Tesouro Direto website.
- Packageqlcal offers QuantLib-based exchange and business calendars for over sixty country or exchange settings.
- Data from Kenneth French’s website can be downloaded with packagefrenchdata. Individual datasets can also be downloaded with function
French in packageNMOF. - Exchange data can be accessed (with a free API subscription) via packagefreecurrencyapi.
CRAN packages
| Core: | fAssets,fBasics,fBonds,fCopulae,fExtremes,fGarch,fImport,fMultivar,fNonlinear,fPortfolio,fRegression,fTrading,PerformanceAnalytics,rugarch,timeDate,timeSeries,tseries,urca,xts,zoo. |
| Regular: | actuar,backtest,bayesGARCH,BCC1997,bearishTrader,BenfordTests,betategarch,bidask,bizdays,BLModel,bmgarch,bondAnalyst,bullishTrader,BurStFin,BurStMisc,CADFtest,car,ChainLadder,copula,copulaData,credule,crseEventStudy,cryptoQuotes,cvar,data.table,derivmkts,DOSPortfolio,Dowd,DriftBurstHypothesis,DtD,dyn,dynlm,epo,ESG,etrm,factorstochvol,FatTailsR,fEGarch,fHMM,FinancialMath,forecast,fracdiff,FRAPO,freecurrencyapi,frenchdata,GARCHSK,garchx,GCPM,gets,GetTDData,ghyp,gmm,gogarch,greeks,HDShOP,highfrequency,IBrokers,ichimoku,InfoTrad,lgarch,lifecontingencies,lmForc,lmtest,longmemo,LSMonteCarlo,LSMRealOptions,markovchain,MarkowitzR,monobin,MSGARCH,mvtnorm,NetworkRiskMeasures,NFCP,nlme,NMOF,nvmix,obAnalytics,OptHedging,OptionPricing,pa,parma,pbo,PeerPerformance,PortfolioOptim,qlcal,qrmdata,qrmtools,quantmod,Rblpapi,Rcmdr,RcppQuantuccia,reinsureR,restimizeapi,rib,Risk,riskParityPortfolio,RiskPortfolios,riskSimul,RM2006,Rmfrac,rmgarch,RND,RQuantLib,RTL,sandwich,sde,SharpeR,Sim.DiffProc,simfinapi,stochvol,stockAnalyst,strand,strucchange,SVDNF,TAQMNGR,tidyquant,timsac,tis,tsDyn,tseriesChaos,TTR,tvm,ufRisk,VaRES,vars,volatilityTrader,vrtest,wavelets,waveslim,wavethresh. |
| Archived: | AssetCorr,BayesianFactorZoo. |
Related links
Other resources
[8]ページ先頭