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
12 - Data Exploration Using Fundamentals
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
As investigated in Chapter 7, income statements and balance sheets provide the investor with a view inside the company. As investors, we would like to know if gross revenue is growing year to year. We may also like to know the market value to book value ratio for a stock we own and compare it to the larger market. Knowing it will help us determine if the company could be overvalued in the stock market.
While “NoSQL,” key–value, and graph databases are all the range of late, SQL databases still offer rapid querying and schemas that support years and decades of historical data. As we will see in this chapter, querying investment fundamentals can be accomplished in the R environment using the RSQLite package. The investor and data scientist can perform the required data mining with very little code, yielding beneficial results. We first begin with some definitions and formulas for investment fundamentals.
Since Chapter 7, and especially in Chapter 10, we focused on the price movement as the primary driver of our investment strategies. In Chapter 7, we had introduced four key income statement metrics and measured their Sharpe Ratio. In this chapter, like Chapter 7, the primary focus will be fundamental metrics of the company's balance sheet rather than price movements and their statistics. We are guided by our intuition and investment principles from classic industry references (Bodie, Kane, and Marcus, 2013; Greenblatt, 2006). In order to set the context regarding fundamentals, we define some basic investment terms and examples and then introduce our data mining package before examining our dataset.
The RSQLite Package
In order to apply some of these fundamental investment principles in a data mining setting, we need a package to perform the computations. SQL is a specialized language for declarative queries against relational databases (Chamberlin and Boyce, 1974). Query results are specified by the main query mechanism, the SELECT statement. SQLite is a widely deployed database engine which uses the SQL language. The source code for SQLite is in the public domain, accessible via http://www.sqlite.org/.
RSQLite is an R package to interface with the SQLite database engine, enabling R to work well with the large datasets we encounter in finance.
- Type
- Chapter
- Information
- Financial Analytics with RBuilding a Laptop Laboratory for Data Science, pp. 281 - 296Publisher: Cambridge University PressPrint publication year: 2016