Follow-up forecasting forum in Eindhoven

Last October I gave a 3-day masterclass on “Forecasting with R” in Eindhoven, Netherlands. There is a follow-up event planned for Tuesday 18 April 2017. It is particularly designed for people who attended the 3-day class, but if anyone else wants to attend they would be welcome.

Please register here if you want to attend. Continue reading →

Simulating from a specified seasonal ARIMA model

From my email today

You use an illustration of a seasonal arima model:


I would like to simulate data from this process then fit a model… but I am unable to find any information as to how this can be conducted… if I set phi1, Phi1, theta1, and Theta1 it would be reassuring that for large n the parameters returned by Arima(foo,order=c(1,1,1),seasonal=c(1,1,1)) are in agreement…

My answer:

Unfortunately arima.sim() won’t handle seasonal ARIMA models. I wrote simulate.Arima() to handle them, but it is designed to simulate from a fitted model rather than a specified model. However, you can use the following code to do it. It first “estimates” an ARIMA model with specified coefficients. Then simulates from it.

model <- Arima(ts(rnorm(100),freq=4), order=c(1,1,1), seasonal=c(1,1,1),
             fixed=c(phi=0.5, theta=-0.4, Phi=0.3, Theta=-0.2))
foo <- simulate(model, nsim=1000)
fit <- Arima(foo, order=c(1,1,1), seasonal=c(1,1,1))

FPP now available as a downloadable e-book

FPP coverMy forecasting textbook with George Athanasopoulos is already available online (for free), and in print via Amazon (for under $40). Now we have made it available as a downloadable e-book via Google Books (for $15.55). The Google Books version is identical to the print version on Amazon (apart from a few typos that have been fixed).

To use the e-book version on an iPad or Android tablet, you need to have the Google Books app installed [iPad, Android]. You could also put it on an iPhone or Android phone, but I wouldn’t recommend it as the text will be too small to read.

You can download a free sample (up to the end of Chapter 2) if you want to check how it will look on your device.

The sales of the print and e-book versions are used to fund the running the OTexts website where all OTexts books are freely available.

The online version is continuously updated — any errors discovered are fixed immediately. The print and e-book versions will be updated approximately annually to bring them into line with the online version.


Resources for the FPP book

The FPP resources page has recently been updated with several new additions including

  • R code for all examples in the book. This was already available within each chapter, but the examples have been collected into one file per chapter to save copying and pasting the various code fragments.
  • Slides from a course on Predictive Analytics from the University of Sydney.
  • Slides from a course on Economic Forecasting from the University of Hawaii.

If any one using the book has other material that could be made available, please send them to me. For example, recorded lectures, slides, additional examples, assignments, exam questions, solutions, etc.

Forecasting with R in WA

On 23-25 September, I will be running a 3-day workshop in Perth on “Forecasting: principles and practice” mostly based on my book of the same name.

Workshop participants will be assumed to be familiar with basic statistical tools such as multiple regression, but no knowledge of time series or forecasting will be assumed. Some prior experience in R is highly desirable.

Venue: The University Club, University of Western Australia, Nedlands WA.

Day 1:
Forecasting tools, seasonality and trends, exponential smoothing.
Day 2:
State space models, stationarity, transformations, differencing, ARIMA models.
Day 3:
Time series cross-validation, dynamic regression, hierarchical forecasting, nonlinear models.

The course will involve a mixture of lectures and practical sessions using R. Each participant must bring their own laptop with R installed, along with the fpp package and its dependencies.

For costs and enrolment details, go to

Errors on percentage errors

The MAPE (mean absolute percentage error) is a popular measure for forecast accuracy and is defined as
\text{MAPE} = 100\text{mean}(|y_t – \hat{y}_t|/|y_t|)
where $y_t$ denotes an observation and $\hat{y}_t$ denotes its forecast, and the mean is taken over $t$.

Armstrong (1985, p.348) was the first (to my knowledge) to point out the asymmetry of the MAPE saying that “it has a bias favoring estimates that are below the actual values”. Continue reading →

My forecasting book now on Amazon

For all those people asking me how to obtain a print version of my book “Forecasting: principles and practice” with George Athanasopoulos, you now can.

FPP cover

Order on

Order on

Order on

The online book will continue to be freely available. The print version of the book is intended to help fund the development of the OTexts platform.

The price is US$45, £27 or €35.

Compare that to $195 for my previous forecasting textbook, $150 for Fildes and Ord, or $182 for Gonzalez-Rivera. No matter how good the books are, the prices are absurdly high.

OTexts is intended to be a different kind of publisher — all our books are online and free, those in print will be reasonably priced.

The online version will continue to be updated regularly. The print version is a snapshot of the online version today. We will release a new print edition occasionally, no more than annually and only when the online version has changed enough to warrant a new print edition.

We are planning an offline electronic version as well. I’ll announce it here when it is ready.