Blog Archives

Math Constants in C++

August 14, 2012
By

Some of my colleagues didn't know that you can use mathematical constants that are part of "cmath". Here is the small snippet that shows how to use PI from cmath library. Be aware that you need to write "#define _USE_MATH_DEFINES" before you include cm...

Read more »

AdfTest Function Enhanced With Rcpp Armadillo

April 26, 2012
By

In my previous post about rewriting my code to run in parallel part one I mentioned that we will make a small change to adfTest() function as well. In this post we will perform this small but performance-dramatic change. When you take a closer look at the source code of this particular function from fUnitRoots package

Read more »

Download Prices From Yahoo In Parallel

April 24, 2012
By

Following my previous post about rewriting my code to run in parallel I have modified the code for downloading the S&P 500 prices from Yahoo to run i parallel as well. To be honest, I quite enjoy writing the code to run in parallel. It's fun for various reasons, but some theoretical background is highly

Read more »

Rewriting My Code to Run in Parallel (1)

April 21, 2012
By

As I have mentioned in my previous post I am about to make my code for finding co-integrated pairs run in parallel and more efficient. But before I do so in the actual co-integration code I would like to run some tests to see whether it would improve t...

Read more »

Pair Trading: Quick Update

April 17, 2012
By

I've been working on different projects lately and my time for this blog, unfortunately, has been close to zero. But that's going to change. Don't expect new post every day, but there should be a new post at least in every two weeks. Anyway, let's get back to the point of this post. One of the readers contacted

Read more »

Pair-Trading in R – Update

May 7, 2011
By

I found amazing R package in one of posts on R-bloggers website. It's called RcppAmadillo and you can find more info here. The function I am using from this package is called fastLm. Whereas I am interested in special case of Ax = b problem where A and...

Read more »

ggplot2 – First impressions

April 29, 2011
By

I was reading various R blogs and saw very nice looking plots created with ggplot2 package. Especially this blog was useful because of link to a very interesting book about ggplot2. I want to display and update the latest co-integrated pairs every day ...

Read more »

Optimizing My R Code

April 25, 2011
By

Thanks to gappy3000 I optimized my code in few several ways. The original script lasted ~30 minutes thanks to using pure vectors instead of zoo objects. First of all I changed all lm functions for lm.fit functions. Although lm.fit function cannot handl...

Read more »

Zoo Slows Down Your Linear Model Function

April 22, 2011
By

I was a bit frustrated when I read Aris's comment to this post about speed of his calculations in Matlab. So I changed the time span of my dataset to 5 years and repeated the whole code. It was VERY disappointing to get the results after more than 5 ho...

Read more »

Pair-Trading with S&P500 Companies – Part II.

April 10, 2011
By

Today I'm going to share with you further outcomes of my research in statistical arbitrage trading technique - pair-trading. In the first part of pair-trading with S&P500 Companies I used downloaded data from yahoo to identify co-integrated pairs. Next stage is to take closer look at results and identify potentially profitable pairs. As an example

Read more »