Book contents
- Frontmatter
- Dedication
- Contents
- Preface
- Acknowledgments
- 1 Analytical Thinking
- 2 The R Language for Statistical Computing
- 3 Financial Statistics
- 4 Financial Securities
- 5 Dataset Analytics and Risk Measurement
- 6 Time Series Analysis
- 7 The Sharpe Ratio
- 8 Markowitz Mean-Variance Optimization
- 9 Cluster Analysis
- 10 Gauging the Market Sentiment
- 11 Simulating Trading Strategies
- 12 Data Exploration Using Fundamentals
- 13 Prediction Using Fundamentals
- 14 Binomial Model for Options
- 15 Black–Scholes Model and Option-Implied Volatility
- Appendix Probability Distributions and Statistical Analysis
- References
- Index
2 - The R Language for Statistical Computing
Published online by Cambridge University Press: 20 October 2016
- Frontmatter
- Dedication
- Contents
- Preface
- Acknowledgments
- 1 Analytical Thinking
- 2 The R Language for Statistical Computing
- 3 Financial Statistics
- 4 Financial Securities
- 5 Dataset Analytics and Risk Measurement
- 6 Time Series Analysis
- 7 The Sharpe Ratio
- 8 Markowitz Mean-Variance Optimization
- 9 Cluster Analysis
- 10 Gauging the Market Sentiment
- 11 Simulating Trading Strategies
- 12 Data Exploration Using Fundamentals
- 13 Prediction Using Fundamentals
- 14 Binomial Model for Options
- 15 Black–Scholes Model and Option-Implied Volatility
- Appendix Probability Distributions and Statistical Analysis
- References
- Index
Summary
Like so many innovations in computing, including the Unix operating system and the C and C++ languages, the R language has its roots at AT&T Bell Laboratories during the 1970s and 1980s in the S language project (Becker, Chambers, and Wilks, 1988). People think that the S language would not have been designed in the way it was if it had been designed by computer scientists (Morandat, Hill, Osvald, and Vitek, 2012). It was designed by statisticians in order to link together calls to FORTRAN packages, which were well known and trusted, and it flourished in the newly developed Unix and C environment. R is an open source variant of S developed at the University of Auckland by Ross Ihaka and Robert Gentleman, first appearing in 1993 (Ihaka, 1998). The chosen rules for scoping of variables and parameter passing make it hard for interpreter and compiler writers to make R run fast. In order to remedy this, packages such as Rcpp have been developed for R, allowing R programs to call pre-compiled C++ programs to optimize sections of the algorithms which are bottlenecks in terms of speed (Eddelbuettel and Sanderson, 2014). We discuss the Rcpp package toward the end of the book.
Clearly the recent popularity of R, fueled by its open source availability and the need for statistical and analytical computing tools, shows that the benefits of R far outweigh the negatives. Overall, R is based upon the vector as a first class item in the language. R shares this attribute with LISP, Scheme, Python, and Matlab. This and the prevalence of over 4,000 publicly available packages are two of the many strengths of R. In this book, we will focus on R packages that revolve around financial analytics.
It is our intention to introduce R at this point for those readers who need or are interested in a summary. Feel free to skip this chapter if you are experienced in R. For those who are not, many of the examples are worth trying out in an R environment to get a feel for the language. By including this section, this book is self-contained and we make no assumption that the reader arrives at this book having an R background.
- Type
- Chapter
- Information
- Financial Analytics with RBuilding a Laptop Laboratory for Data Science, pp. 7 - 22Publisher: Cambridge University PressPrint publication year: 2016
- 2
- Cited by