Blog Archives

Cover of my forecasting textbook

March 18, 2014
By
Cover of my forecasting textbook

We now have a cover for the print version of my forecasting book with George Athanasopoulos. It should be on Amazon in a couple of weeks. The book is also freely available online. This is a variation of the most popular one in the poll conducted a mon...

Read more »

Fast computation of cross-validation in linear models

March 17, 2014
By
Fast computation of cross-validation in linear models

The leave-one-out cross-validation statistic is given by     where , are the observations, and is the predicted value obtained when the model is estimated with the th case deleted. This is also sometimes known as the PRESS (Prediction Residual Sum of Squares) statistic. It turns out that for linear models, we do not actually have to estimate the...

Read more »

Testing for trend in ARIMA models

March 12, 2014
By
Testing for trend in ARIMA models

Today’s email brought this one: I was wondering if I could get your opinion on a particular problem that I have run into during the reviewing process of an article. Basically, I have an analysis where I am looking at a couple of time-series and I wanted to know if, over time there was an upward trend in the...

Read more »

Unit root tests and ARIMA models

March 12, 2014
By

An email I received today: I have a small problem. I have a time series called x : - If I use the default values of auto.arima(x), the best model is an ARIMA(1,0,0) - However, I tried the function ndiffs(x, test=“adf”) and ndiffs(x, test=“kpss”) as the KPSS test seems to be the default value, and the number of difference...

Read more »

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 »