This page lists a collection of useful information and software for actuaries interested in using R!.
Integrated Development Environments
RStudio™ is a free and open source integrated development environment for R. It runs under Windows, Mac, or Linux, and can be both a desktop or a server application. It also has built-in support for Sweave and knitr, the two packages most used to develop pdfs based on LaTeX that contain R code, as well as support for creating HTML pages which contain R code for publication on the web. It also contains built-in support for version control, and can be linked to git and subversion repositories.
This GUI is an easy way to get introduced to R, but it is limited. It is intended to help users move from the GUI interface to writing commands. GLMs can be performed in the interface as is. Instructions for downloading R-Commander can be found here. The installation process is covered for Windows, Mac OS, and Linux/Unix systems.
Only available for Windows systems, this allows for R, with or without R-Commander, to be used as a tool within Excel. Instructions for download can be found here. It allows for data transfers between R and Excel as well as calling R functions from within Excel cell formulæ. R Through Excel is a reference available on this topic.
Another add-in for Excel that allows for calling R formulas from within Excel cell formulas. It is currently available here.
Rattle is a data mining toolkit for use with R.
This is a Java GUI for R which includes an editor capable of autocompletion, syntax highlighting, and direct command transfer. An object browser, help system, and other features are included. Click here for more information on JGR.
This tool can be used to connect R with WinEdt for LaTeX and is useful for creating documents. Information and instructions for downloading and installation can be found here. As of October 2011, version 2 of R-WinEdt works for both the WinEdt version 5 and version 6 families.
Just Another Gibbs Sampler (JAGS) is a program for analyzing hierarchical Bayesian models using Markov Chain Monte Carlo (MCMC) methods, similar to BUGS. The package is developed and maintained by Martyn Plummer. It has available Windows, Mac OSX, and Linux binaries, and can be be compiled from source code as well. It is free and open source software, distributed under the GNU General Public License.
It is a stand-alone program with compiled code for speed, which can be called from the command line or from inside other statistical routines.
There are at least three R packages which can be used to interface with JAGS: rjags, runjags, and R2jags.
Stan is a freedom-respecting, open-source software package for performing Bayesian inference using the No-U-Turn sampler, a variant of Hamiltonian Monte Carlo. Stan can be called from the command line, from within R, and from within the Python programming language. It follows a similar, but not identical, model creation and definition structure to the BUGS family (WinBUGS, OpenBUGS, JAGS) and claims to achieve much faster convergence through its use of Hamiltonian Monte Carlo and run-time compilation.
FAViR stands for Formatted Actuarial Vignettes in R. The goal of FAViR is to lower the learning curve of the R environment, helping actuaries quickly produce and format the solutions to practical actuarial problems.
FAViR takes the form of a series of Sweave papers and an associated package. All code is free software (open source and GPL compatible). Readers can apply the techniques in each paper to their own data simply by changing the inputs. To assure consistency and quality, FAViR papers are peer reviewed and follow the same style manual.
Piet de Jong and Gillian Z. Heller have compiled several data sets relevant to insurance and actuarial science.
Jed Frees also has many good data sets.
Here are data sets on loss reserves.
R Library (UCLA): This resource has information on the various bootstrapping functions available through R and does a quick walk-through example.
Quick-R: This site also provides examples of bootstrapping functions in R.
Chain-Ladder Model Resource
Here is some useful information on the Chain Ladder package for R. The ChainLadder package contains functions that carry out the Mack method (including a multivariate version), bootstrapping, Munich Chain Ladder, and the LDF and CapeCod methods in David Clark's "LDF Curve Fitting" paper in the 2003 CAS Forum.
LDF Curve Fitting using Dave Clark's method
This presentation introduces the methods in Clark's paper and gives a schematic of how his maximum likelihood approach was implemented in the ChainLadder package.
MRMR (Multivariate Regression Model for Reserving)
MRMR is an R package for use in evaluating non-life insurance reserves. At present, the package may be obtained as a tarball from its GitHub development site. MRMR Package.
Information about fitting generalized linear models in R can be found here.
Actuar provides many actuary-specific functions and data sets, including features in risk theory, loss distributions modeling, credibility theory, and simulation of compound hierarchical models.
POT (Peaks Over Threshold) Package
The POT package is useful with respect to the Extreme Value Theorem, simulating and fitting the EVT-definition Generalized Pareto.