Blog Archives

Density Plot with ggplot

December 18, 2012
By
Density Plot with ggplot

This is a follow on from the post Using apply sapply and lappy in R.The dataset we are using was created like so:m <- matrix(data=cbind(rnorm(30, 0), rnorm(30, 2), rnorm(30, 5)), nrow=30, ncol=3)Three columns of 30 observations, normally distributed with means of 0, 2 and 5. We want a density plot to compare the distributions of the three columns...

Read more »

Using apply, sapply, lapply in R

December 18, 2012
By

This is an introductory post about using apply, sapply and lapply, best suited for people relatively new to R or unfamiliar with these functions. There is a part 2 coming that will look at density plots with ggplot, but first I thought I would go on a tangent to give some examples of the apply family, as they...

Read more »

Multidimensional Scaling and Company Similarity

July 30, 2012
By
Multidimensional Scaling and Company Similarity

Background and ideaOften we are looking at a particular sector, and want to get a quick overview of a group of companies relative to one another. I thought I might apply Multidimensional Scaling (MDS) to various financial ratios and see if it...

Read more »

Another cut at market randomness

May 20, 2012
By
Another cut at market randomness

I have some background in computer security and one day found myself tasked with assessing the quality of randomness for session id tokens generated by popular web frameworks (namely Java and .NET). As it turns out, NIST have developed a series of tests for just this purpose detailed here.As a non-believer in the absolute randomness of markets, I thought...

Read more »

Mebane Faber Tactical Asset Allocation in R

April 13, 2012
By

In 2006 Mebane Faber published a great piece of research detailing an asset allocation system that was both very easy to understand and implement, as well as carrying very respectable risk adjusted returns.The details are available in his paper&nb...

Read more »

Machine Learning Examples in R

February 12, 2012
By
Machine Learning Examples in R

This is a post that has been a long time in the making. Following on from the excellent Stanford Machine Learning Course I have made examples of the main algorithms covered in R.We have Linear RegressionFollowed by Neural NetworksAnd Support ...

Read more »

Trading Mean Reversion with Augen Spikes

October 14, 2011
By
Trading Mean Reversion with Augen Spikes

One of the more interesting things I have come across is the idea of looking at price changes in terms of recent standard deviation, a concept put forward by Jeff Augen. The gist is to express a close to close return as a function of the standard devia...

Read more »

Jeff Augen Volatility Spike Code in R

October 2, 2011
By
Jeff Augen Volatility Spike Code in R

Jeff Augen has written many excellent books on options trading, including&nb...

Read more »

Adding a volatility filter with VIX

October 2, 2011
By
Adding a volatility filter with VIX

We saw in the basic system how we could add a factor, namely the 200 day moving average, to improve the overall performance of our system. You could spend a lot of time playing with different moving averages, and different combinations of crossovers if...

Read more »