Blog Archives

Just for fun: attractors in R

November 24, 2013
By
Just for fun: attractors in R

I have a borderline unhealthy obsession with attractors. I thought I got it out of my system, but here we are. For whatever reason, I felt like making some in R.You can find the R code here. It uses the attractor function to define density in a ma...

Read more »

Book Review: Applied Predictive Modeling by Max Kuhn and Kjell Johnson

November 24, 2013
By

This is a gem of a book.From the introduction: We intend this work to be a practitioner’s guide to the predictive modeling process and a place where one can come to learn about the approach and to gain intuition about the many commonly used and modern, powerful models. …it was our goal to be as hands-on as possible, enabling the readers...

Read more »

Another Rcpp/RcppArmadillo success story

October 25, 2013
By

I finally had an excuse to try out RcppArmadillo and was amazed at just how well it worked out.The exact details are a bit beyond a blog post, but basically I had a matrix of roughly 80,000x2 double valued samples (call it A) and needed to fi...

Read more »

The case for data snooping

October 25, 2013
By
The case for data snooping

When we are backtesting automated trading systems, accidental data snooping or look forward errors are an easy mistake to make. The nature of the error in this context is making our predictions using the data we are trying to predict. Typically, it comes from a mistake with our calculations of time offsets somewhere.However, it can be a...

Read more »

Building models over rolling time periods

September 23, 2013
By

Often I have some idea for a trading system that is of the form “does some particular aspect of the last n periods of data have any predictive use for subsequent periods.”I generally like to work with nice units of time, such as 4 weeks or 6 months, rather than 30 or 126 days. It probably doesn’t...

Read more »

Type conversion and you (or and R)

September 5, 2013
By

Types and type conversion can be a tricky and intricate topic, and sometimes can lead to some real head-scratcher issues in R. Hence a somewhat confusing title.This is for people still relatively new to R, and I will skip some gory details. Actually I will skip most of them, the canonical source for type and conversion information is the...

Read more »

A volatility filter using historical vol

March 6, 2013
By
A volatility filter using historical vol

We have been looking at a way to improve risk adjusted returns by using a volatility filter. Although we could use VIX or equivalent, it turns out that historical volatility will work just as well, if not a little better.You can see part 1 here Digging into the VIX, and part 2 here What can we use...

Read more »

What can we use the VIX for?

March 3, 2013
By
What can we use the VIX for?

In part 1, we took a look at VIX and the relationship it had between historical volatility and realized volatility.Continuing on, I thought I would take a look at next day returns and the VIX. There is a relationship between SPX and VIX in that when SP...

Read more »

Digging into the VIX

March 3, 2013
By
Digging into the VIX

I wanted to revisit using some sort of volatility filter for systematic trading. In particular, if we are trading SPX, can we somehow use the VIX to produce better risk adjust returns? This is not about trading volatility, but more about using addition...

Read more »

Tracking down errors in R

January 29, 2013
By

It's that moment we all know and love, somewhere in our code something has gone wrong. We think we have done everything right, but instead of expected glory we find only terse red text lain below our lintel. This can be very frustrating, and trouble shooting these issues can often be very time consuming. All is not lost. There are a...

Read more »