#### 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

## The estimation problem

We cannot observe the term structure directly, but we can observe the market prices of instruments whose price depends on the term structure and thus estimate the term structure. A good source of information regarding the term structure is the government bond market, where usually a lot of liquid securities are traded whose prices depend solely on the term structure.

Suppose there are n bonds traded whose gross (or dirty) prices are denoted by . There are m dates when at least one bond's owners receive a payment. These payments are due in years time respectively where . The matrix C contains the cash flows of the bonds. We model bond prices as the sum of the present value of the bond's cash flow and a normally distributed error term:

Here d is the vector containing the discount factors and is a vector containing the error terms. The observed market price of a bond can differ from the present value of the cash flow for two reasons: there might be a measurement error...