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

When variance is not enough


Variance as a risk measure is convenient, but has some drawbacks. For instance, when using variance, positive changes in the return can be considered as the increase of risk. Therefore, more sophisticated risk measures have been developed.

For example, see the following short demo about various methods applied against the previously described IT_return assets for a quick overview about the options provided by the fPortfolio package:

> Spec <- portfolioSpec()
> setSolver(Spec) <- "solveRshortExact"
> setTargetReturn(Spec) <- mean(colMeans(IT_return))
> efficientPortfolio(IT_return, Spec, 'Short')
> minvariancePortfolio(IT_return, Spec, 'Short')
> minriskPortfolio(IT_return, Spec)
> maxreturnPortfolio(IT_return, Spec)

These R expressions return different portfolio weights computed by various methods not discussed in this introductory chapter. Please refer to the package bundled documentation, such as ?portfolio, and the relevant articles...