If you have purchased a Packt book and/or video, you can use this page to
• Download the code or support files
• View errata and amendments
• Send us feedback

## You selected ### Introduction to R for Quantitative Finance

#### Published 2013-11-22

Would you like to receive occasional emails about free content, recommended titles and site wide deals? you can unsubscribe at any time.

## Errata

- 6 submitted: last submission 16 May 2017

The code bundle has been updated with the source code for R.

Page no: 78 | Errata type: Code

The given code is:

> c(floor(min(y[, 1])), max(m[, ncol(m)]))

It should be:

> c(floor(min(m[, 1])), max(m[, ncol(m)]))

Page no: 79 | Errata type: Code

The given code is:

> c(floor(min(y[, 1])), apply(as.matrix(m[, h]), 2, max) + theta *
(apply(as.matrix(m[, h + 1]), 2, max) - apply(as.matrix(m[, h]), 2,
max)), max(m[, ncol(m)]))

It should be:

> c(floor(min(m[, 1])), apply(as.matrix(m[, h]), 2, max) + theta *
(apply(as.matrix(m[, h + 1]), 2, max) - apply(as.matrix(m[, h]), 2,
max)), max(m[, ncol(m)]))

Page number: 18
|Errata type: code

> mod_ecm <- lm(djf ~ dho + error_lag)

should be replaced with

>mod_ecm <- lm(djf ~ dho + error_lag + 0)

Chapter 2: Portfolio Optimization, Section: Working with real data, Page: 32

The link given for the .csv file is:
http://www.quandl.com/api/v1/datasets/USER_1KR/1KT.csv

It should be:
https://www.quandl.com/api/v1/datasets/DAROCZI/IT.csv

Also the command given is:

> IT <- Quandl('USER_1KR/1KT', start_date = '2008-01-01', end_date = '2012-12-31')

It should be:

IT <- Quandl('DAROCZI/IT', start_date = '2008-01-01', end_date = '2012-12-31')

Errata type: Code l Page no: 104

Missing line above text 'It is useful to plot this curve:'

creditspreads <- 1/T * log( K / D ) - r
"