Getting started with R
R is a free software environment for statistical computing and graphics. To download R and find documentation and FAQs, please visit The R Project for Statistical Computing. RStudio provides a free open-source IDE, which also serves as a convenient GUI for users.
All R scripts are available from our public GitHub repository. To see what is available, follow the chapter links below. For each chapter a README is displayed which summarizes the available R scripts. You can download individual files by following the links to the raw versions. You can also download the complete GitHub repository as a zip file.
How to use the R scripts
- You will need to have R installed on your computer.
- Some scripts require additional R packages. This will typically be indicated in the first few lines of the script by a
library(qrmtools). Most of the packages we use are available on CRAN (including qrmtools and qrmdata). To install a release version of a package from CRAN a command like
install.packages("qrmtools")from inside R will generally work.
- The R scripts and packages are under constant development. This might require you to update packages to the latest development versions. For packages developed on R-Forge (development server), this can typically be done with
install.packages("qrmtools", repos = "http://R-Forge.R-project.org"). Should there be any problem during the installation, download the source code from this directory and compile. Type
?install.packagesat the R command line for more information.
R scripts for the textbook
- Chapter 1: An Introduction to R Programming
- Chapter 2: Basic Concepts in Risk Management
- Chapter 3: Empirical Properties of Financial Data
- Chapter 4: Financial Time Series
- Chapter 5: Extreme Value Theory
- Chapter 6: Multivariate Models
- Chapter 7: Copulas and Dependence
- Chapter 8: Aggregate Risk
- Chapter 9: Market Risk
- Chapter 10: Credit Risk
- Chapter 11: Portfolio Credit Risk Management
- Chapter 12: Portfolio Credit Derivatives
- Chapter 13: Operational Risk and Insurance Analytics
- Chapter 14: Multivariate Time Series