Blog Archives

Time series cross-validation 4: forecasting the S&P 500

June 11, 2012
By
Time series cross-validation 4: forecasting the S&P 500

I finally got around to publishing my time series cross-validation package to github, and I plan to push it out to CRAN  shortly.You can clone the repo using github for mac, for windows, or linux, and then run the following script to...

Read more »

My first R package: parallel differential evolution

January 23, 2012
By
My first R package: parallel differential evolution

Last night I was working on a difficult optimization problems, using the wonderful DEoptim package for R. Unfortunately, the optimization was taking a long time, so I thought I'd speed it up using a foreach loop, which resulted in the fo...

Read more »

Benchmarking time series models

December 29, 2011
By
Benchmarking time series models

This is a quick post on the importance of benchmarking time-series forecasts.  First we need to reload the functions from my last few posts on times-series cross-validation.  (I copied the relevant code at the bottom of this post so you don't...

Read more »

Time series cross-validation 3

December 12, 2011
By
Time series cross-validation 3

I've updated my time-series cross validation algorithm to fix some bugs and allow for a possible xreg term.     This allows for cross-validation of multivariate models, so long as they are specified as a function with the following ...

Read more »

A pure R poker hand evaluator

December 5, 2011
By
A pure R poker hand evaluator

There's already a lot of great posts out there about poker hand evaluators, so I'll keep this short.  Kenneth J. Shackleton recently released a very slick 5-card and 7-card poker hand evaluator called SpecialK.  This evaluator is li...

Read more »

Time series cross-validation 2

November 22, 2011
By
Time series cross-validation 2

In my previous post, I shared a function for parallel time-series cross-validation, based on Rob Hyndman's code.  I thought I'd expand on that example a little bit, and share some additional wrapper functions I wrote to test other forecasting&nbsp...

Read more »

Functional and Parallel time series cross-validation

November 21, 2011
By
Functional and Parallel time series cross-validation

Rob Hyndman has a great post on his blog with example on how to cross-validate a time series model.  The basic concept is simple:  You start with a minimum number of observations (k), and fit a model (e.g. an arima model) to those observation...

Read more »

Backtesting Part 4: random strategies

October 21, 2011
By
Backtesting Part 4: random strategies

Note: This post is NOT financial advice!  This is just a fun way to explore some of the capabilities R has for importing and manipulating data.  In part 2, we found that our 200-day high, hold 100 days strategy yielded average annual return...

Read more »

Backtesting a Simple Stock Trading Strategy: Part 3

October 17, 2011
By
Backtesting a Simple Stock Trading Strategy: Part 3

Note: This post is NOT financial advice!  This is just a fun way to explore some of the capabilities R has for importing and manipulating data.  In a previous post, I examined a simple stock trading strategy: Find the high point over the la...

Read more »

Recession forecasting III: A Better Naive Forecast

September 20, 2011
By
Recession forecasting III: A Better Naive Forecast

In Recession Forecasting Part II, I compared the accuracy of Hussman's recession forecasts to the accuracy of a naive forecast that assumed the current state of the recession variable would continue next month.An anonymous comment...

Read more »