Blog Archives

HMM example with depmixS4

September 21, 2014
By
HMM example with depmixS4

On a scale of one to straight up voodoo, Hidden Markov Models (HMMs) are definitely up there for me.They have all sorts of applications, and as the name suggests, they can be very useful when you wish to use a Markovian approach to represent some stochastic process.In loose terms this just means we wish to represent our process as...

Read more »

Bayesian Naive Bayes for Classification with the Dirichlet Distribution

July 14, 2014
By

I have a classification task and was reading up on various approaches. In the specific case where all inputs are categorical, one can use “Bayesian Naïve Bayes” using the Dirichlet distribution.  Poking through the freely available text by Barber, I found a rather detailed discussion in chapters 9 and 10, as well as example matlab code for the...

Read more »

Trading in a low vol world

June 22, 2014
By
Trading in a low vol world

I wanted to take a look at what works in low vol environments, such as we are currently experiencing. I am open to the idea we have entered a period of structurally low volatility due to increased regulatory burden and flow on effects from the dec...

Read more »

A quick look at FX realized vol

May 31, 2014
By
A quick look at FX realized vol

Much has been said about the decline in volatility. At the moment I am very active in FX spot trading and as a generalization do better the more vol there is. I wanted to see how things stood on the crosses I am most active in, namely EUR/USD, GBP/USD and USD/JPY. I took hourly data from FxPro (not my broker, nor...

Read more »

RcppArmadillo cheatsheet

May 17, 2014
By

I have been using RcppArmadillo more and more frequently, so thought I would make a cheatsheet/cookbook type reference that translates common R operations into equivalent arma code.I have put them up on a github wiki page here.The functions are al...

Read more »

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 »