O'Reilly logo

Introduction to R for Quantitative Finance by Zsolt Tulassay, Dr. Kata Váradi, Péter Csóka, Michael Puhle, Márton Michaletzky, Gergely Daróczi, Dr. Edina Berlinger, Daniel Havran, Agnes Vidovics-Dancs

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Beta estimation

The sensitivity of a security towards a factor can be estimated from past price movements. We will estimate the beta from the one-factor index model. First, we show the process of collecting and synchronizing data from different sources and then present the simple beta estimation method and, at last, a linear regression model is built.

Data selection

We download the time series of the price of a given stock, for example Google, and the time series of the price of the market index, the S&P 500, from June 1st 2009 to June 1st 2013 from Quandl, as discussed in the second chapter:

> library(Quandl)
> Quandl.auth("yourauthenticationtoken")
> G <- Quandl('GOOG/NASDAQ_GOOG',
+   start_date = '2009-06-01', end_date = '2013-06-01')

The resulting ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required