Book Image

Introduction to R for Quantitative Finance

By : Gergely Daróczi, Michael Puhle, Edina Berlinger (EURO), Daniel Daniel Havran, Kata Váradi, Agnes Vidovics-Dancs, Agnes Vidovics Dancs, Michael Phule, Zsolt Tulassay, Peter Csoka, Marton Michaletzky, Edina Berlinger (EURO), Varadi Kata
Book Image

Introduction to R for Quantitative Finance

By: Gergely Daróczi, Michael Puhle, Edina Berlinger (EURO), Daniel Daniel Havran, Kata Váradi, Agnes Vidovics-Dancs, Agnes Vidovics Dancs, Michael Phule, Zsolt Tulassay, Peter Csoka, Marton Michaletzky, Edina Berlinger (EURO), Varadi Kata

Overview of this book

Introduction to R for Quantitative Finance will show you how to solve real-world quantitative fi nance problems using the statistical computing language R. The book covers diverse topics ranging from time series analysis to fi nancial networks. Each chapter briefl y presents the theory behind specific concepts and deals with solving a diverse range of problems using R with the help of practical examples.This book will be your guide on how to use and master R in order to solve quantitative finance problems. This book covers the essentials of quantitative finance, taking you through a number of clear and practical examples in R that will not only help you to understand the theory, but how to effectively deal with your own real-life problems.Starting with time series analysis, you will also learn how to optimize portfolios and how asset pricing models work. The book then covers fixed income securities and derivatives such as credit risk management.
Table of Contents (17 chapters)
Introduction to R for Quantitative Finance
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Theoretical overview


Let the random variable X represent the random loss that we would like to model, with F(x) = P(X ≤ x) as its distribution function. For a given threshold u, the excess loss over the threshold Y = X – u has the following distribution function:

For a large class of underlying loss distributions, the Fu(y) distribution of excess losses over a high threshold u converges to a Generalized Pareto distribution (GPD) as the threshold rises toward the right endpoint of the loss distribution. This follows from an important limit theorem in EVT. For details, the reader is referred to McNeil, Frey, and Embrechts (2005). The cumulative distribution function of GPD is the following:

Here ξ is generally referred to as the shape parameter and β as the scale parameter.

Though strictly speaking, the GPD is only the limiting distribution for excess losses over a high threshold, however, it serves as the natural model of the excess loss distribution even for finite thresholds. In other words...