Blog Archives

Using old versions of R packages

March 9, 2014
By

I received this email yesterday: I have been using your ‘forecast’ package for more than a year now. I was on R version 2.15 until last week, but I am having issues with lubridate package, hence decided to update R version to R 3.0.1. In our organization even getting an open source application require us to go through a...

Read more »

Forecasting weekly data

March 4, 2014
By
Forecasting weekly data

This is another situation where Fourier terms are useful for handling the seasonality. Not only is the seasonal period rather long, it is non-integer (averaging 365.25/7 = 52.18). So ARIMA and ETS models do not tend to give good results, even with a period of 52 as an approximation. Regression with ARIMA errors The simplest approach is a regression...

Read more »

Fitting models to short time series

March 3, 2014
By
Fitting models to short time series

Following my post on fitting models to long time series, I thought I’d tackle the opposite problem, which is more common in business environments. I often get asked how few data points can be used to fit a time series model. As with almost all sample size questions, there is no easy answer. It depends on the number of model parameters...

Read more »

More time series data online

February 27, 2014
By

Earlier this week I had coffee with Ben Fulcher who told me about his online collection comprising about 30,000 time series, mostly medical series such as ECG measurements, meteorological series, birdsong, etc. There are some finance series, but not ma...

Read more »

The forecast mean after back-transformation

February 24, 2014
By
The forecast mean after back-transformation

Many functions in the forecast package for R will allow a Box-Cox transformation. The models are fitted to the transformed data and the forecasts and prediction intervals are back-transformed. This preserves the coverage of the prediction intervals, and the back-transformed point forecast can be considered the median of the forecast densities (assuming the forecast densities on the transformed scale...

Read more »

Forecasting within limits

February 21, 2014
By
Forecasting within limits

It is common to want forecasts to be positive, or to require them to be within some specified range . Both of these situations are relatively easy to handle using transformations. Positive forecasts To impose a positivity constraint, simply work on the log scale. With the forecast package in R, this can be handled by specifying the Box-Cox parameter...

Read more »

Backcasting in R

February 19, 2014
By
Backcasting in R

Sometimes it is useful to “backcast” a time series — that is, forecast in reverse time. Although there are no in-built R functions to do this, it is very easy to implement. Suppose x is our time series and we want to backcast for periods. Here is some code that should work for most univariate time series. The example...

Read more »

Global energy forecasting competitions

February 19, 2014
By
Global energy forecasting competitions

The 2012 GEFcom competition was a great success with several new innovative forecasting methods introduced. These have been published in the IJF as follows: Hong, Pinson and Fan. Global Energy Forecasting Competition 2012 Charleton and Singleton. A refined parametric model for short term load forecasting Lloyd. GEFCom2012 hierarchical load forecasting: Gradient boosting machines and Gaussian processes Nedelec, Cugliari and Goude: GEFCom2012: Electric...

Read more »

Hierarchical forecasting with hts v4.0

February 12, 2014
By

A new version of my hts package for R is now on CRAN. It was completely re-written from scratch. Not a single line of code survived. There are some minor syntax changes, but the biggest change is speed and scope. This version is many times faster than the previous version and can handle hundreds of thousands of time series...

Read more »

Detecting seasonality

February 7, 2014
By
Detecting seasonality

I occasionally get email asking how to detect whether seasonality is present in a data set. Sometimes the period of the potential seasonality is known, but in other cases it is not. I’ve discussed before how to estimate an unknown seasonal period, and how to measure the strength of the seasonality. In this post, I want to look at...

Read more »