#### 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.
Introduction to R for Quantitative Finance
Credits
www.PacktPub.com
Preface
Free Chapter
Time Series Analysis
Portfolio Optimization
Asset Pricing Models
Fixed Income Securities
Estimating the Term Structure of Interest Rates
Derivatives Pricing
Credit Risk Management
Extreme Value Theory
References
Index

## Credit default models

The goal of the first part of the chapter is to show the methods of using R for pricing and performing Monte Carlo simulations with standard credit risk models. The following sections give an essential picture of loss distributions and the generating and pricing of a single debt instrument.

### Structural models

We start with the well-known option-based model of Merton (Merton 1974) as the introductory model of structural approach. Merton evaluates risky debt as a contingent claim of the firm value. Let us suppose that the `V` firm value follows geometric Brownian motion:

In the preceding formula, `μ` is the drift parameter, `σ>0` is the volatility parameter, `dW` is the differential of the Wiener process, and the initial asset value is `V0>0`. The model assumes a flat yield curve, with `r` as the constant interest rate, and lets us define the default state as that where the value of the assets V falls below the liabilities (`K`) upon the of maturity of debt (T). We express the VT...