All the code from the book can be downloaded here. There is one page per chapter. For documentation on each piece of code, please consult the book.

Each piece of code is labeled by the last date it got updated. If the date is 25/02/11 then it is identical to the book. If it is more recent, some bug fix or improvements have been implemented.

Some of the code, especially that implementing GARCH and especially multivatiate GARCH reflects the state of the available libraries in 2011. We are working on updating the code and new versions are expected to be ready by August 2015.

If anybody suggests alternative implementations to what is here we would be happy to include a link.

Chapter 1. Financial Markets, Prices and Risk
Chapter 2. Univariate Volatility Modeling
Chapter 3. Multivariate Volatility Models
Chapter 4. Risk Measures
Chapter 5. Implementing Risk Forecasts
Chapter 6. Analytical Value–at–Risk for Options and Bonds
Chapter 7. Simulation Methods for VaR for Options and Bonds
Chapter 8. Backtesting and Stress Testing
Chapter 9. Extreme Value Theory
Chapter B. An Introduction to R
Chapter C. An Introduction to Matlab

Financial Risk Forecasting
Copyright (C) 2011 Jon Danielsson. All Rights Reserved.
GNU General Public License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see