The following R library named ‘FinCal’ allows the user to calculate a wide variety of financial metrics and ratios. The Comprehensive R Archive Network goes into much more detail on these. However, the below is a selection of ratios that […]
Continue reading »Category: R
Quantmod: Analyse Stock and Forex Data Using R
The quantmod library in R allows for streaming of financial data. This is quite useful when it comes to analysing financial markets and formulating quantitative trading strategies on the basis of such data. Let’s take a look at how quantmod […]
Continue reading »Graph Functions Using R
R is not only a great programming tool for analysing statistics-based data; its graphing capabilities are wide-ranging and in many cases rival traditional packages such as SPSS and STATA. In the case of functions, we see that we can use […]
Continue reading »Differentiation, One-Dimensional, and Multi-Dimensional Integration in R
The following illustrates how one can calculate first-order derivatives, one-dimensional and multi-dimensional integrals using the R software: Differentiation fx = expression(x^2+2*x+3, ‘x’) D(fx , ‘x’) 2 * x + 2 fy = expression((z^3)+(2*z^2)+3, ‘z’) D(fy , ‘z’) 3 * […]
Continue reading »Decomposition of Additive Time Series
A time series is made up of several elements, namely the observed, trend, seasonal and random elements. Decomposition is the method by which we extract each element from an observed time series. What do we mean by each of these? […]
Continue reading »Serial Correlation: Durbin-Watson and Cochrane-Orcutt Remedy
Serial correlation (also known as autocorrelation) is a violation of the Ordinary Least Squares assumption that all observations of the error term in a dataset are uncorrelated. In a model with serial correlation, the current value of the error term […]
Continue reading »R Programming Can Dramatically Trim Analytics Costs
In an era where the emphasis of Data Science is slowly but surely leaning towards advanced analysis (often with high costs) and the revealing of key insights from a long stream of otherwise innocuous data, it appears that managers have […]
Continue reading »ARIMA and R: Stock Price Forecasting
ARIMA (Autoregressive Integrated Moving Average) is a major tool used in time series analysis to attempt to forecast future values of a variable based on its present value. For this particular example, I use a stock price dataset of Johnson […]
Continue reading »Stationarity and Cointegration in R (adf, egcm, pp, kpss)
When we refer to a time series as stationary, we mean to say that its mean, variance and autocorrelation are all consistent over time. Cointegration, on the other hand, is when we have two time series that are non-stationary, but […]
Continue reading »