Granger Causality Test
# READ QUARTERLY DATA FROM CSV library(zoo) ts1 <- read.zoo(‘Documents/data/macros.csv’, header = T, sep = ",", FUN = as.yearqtr) # CONVERT THE DATA TO STATIONARY TIME SERIES ts1$hpi_rate <- log(ts1$hpi...continue reading.
# READ QUARTERLY DATA FROM CSV library(zoo) ts1 <- read.zoo(‘Documents/data/macros.csv’, header = T, sep = ",", FUN = as.yearqtr) # CONVERT THE DATA TO STATIONARY TIME SERIES ts1$hpi_rate <- log(ts1$hpi...continue reading.
It is always fun to find trend in time series data. But what about the scenarios where the trend in the time series changes. Detecting the point of this trend...continue reading.
An Outlier is defined as a point (or set of points) in the dataset that do not follow the dominant pattern of the data. Due to wide variety of outlier...continue reading.
Stata 14 has just been released. The new and big thing with version 14 is the introduction of Bayesian Statistics. A wide variety of new models can now be estimated...continue reading.
The example below shows how to estimate a simple univariate Poisson time series model with the tscount package. While the model estimation is straightforward and yeilds very similar parameter estimates...continue reading.
Modeling the time series of count outcome is of interest in the operational risk while forecasting the frequency of losses. Below is an example showing how to estimate a simple...continue reading.
An universally used generative unsupervised clustering is Gaussains Mixture Model (GMM) which is also known as “EM Clustering”. The idea of GMM is very simple: for a given dataset, each...continue reading.
Bayesian networks (BNs) are a type of graphical model that encode the conditional probability between different learning variables in a directed acyclic graph. There are benefits to using BNs compared...continue reading.
As a data scientist, occasionally, you receive a dataset and you would like to know what is the generative distribution for that dataset. In this post, I aim to show...continue reading.
Consider the following example: there is a three-stage truck maintenance pipeline. Initially, when a Truck comes to the maintenance service, it is added to the first stage and its status...continue reading.
R is great when it works. Not so much, when it doesn’t. Specifically, this becomes a concern when the packages are not fully illustrated in the accompanied help documentation, and...continue reading.
pkgs <- c(‘sas7bdat’, ‘betareg’, ‘lmtest’) lapply(pkgs, require, character.only = T) df1 <- read.sas7bdat("lgd.sas7bdat") df2 <- df1[which(df1$y < 1), ] xvar <- paste("x", 1:7, sep = ”, collapse = " +...continue reading.
The other week a user of ggtern ran into a problem where they wanted to use the limit_tern(…) functionality, however there were a few marginal points / paths that extended...continue reading.
In econometrics, generalized method of moments (GMM) is one estimation methodology that can be used to calculate instrumental variable (IV) estimates. Performing this calculation in R, for a linear IV...continue reading.
We wanted to have an idea of the general form of the forward curve for London ICE gasoil futures contracts along the year. The R code below plot a forward curve...continue reading.
Earlier this weekend (Dec. 7, 2013), mnlogit was released on CRAN by Wang Zhiyu and Asad Hasan ([email protected]) claiming that mnlogit uses “parallel C++ library to achieve fast computation of Hessian matrices”....continue reading.
Cohort analysis is super important if you want to know if your service is in fact a leaky bucket despite nice growth of absolute numbers. There’s a good write up...continue reading.