Nada es Gratis

Hoy ha salido un post en el blog Nada es Gratis de José I Castillo y un servidor (aquí) sobre la crisis económica y las predicciones macroeconómicas que se nos vienen encima como consecuencia de la pandemia. Es obvio darse cuenta que la dificultad de tales predicciones es enorme, por lo que allí ofrecemos una sencilla herramienta que permite a quien se la descargue plantear sus propios escenarios, de forma que puede obtener la predicción del PIB para 2020. ¡Que aproveche!


Finally the ECOTOOL toolbox for Matlab was published in PLOS ONE (Time series analysis and forecasting with ECOTOOL).
It embodies several routines for identification, validation and forecasting of dynamic models. The toolbox includes a wide range of exploratory, descriptive and diagnostic statistical tools with visual support, designed in easy-to-use Graphical User Interfaces, and may be downloaded from here.
It also incorporates complex automatic procedures for identification, exact maximum likelihood estimation and outlier detection for many types of models available in the literature (like multi-seasonal ARIMA models, transfer functions, Exponential Smoothing, Unobserved Components, VARX). You may estimate, for example, exponential smoothing or unobserved components models with automatic identification of outliers, something I have never seen before. You also may run the automatic identification of ARIMA models with two seasonalities (like diurnal and weekly)…
Just with a few lines of code you may run a comprehensive analysis of time series. The toolbox is supplied with an in-depth documentation system and online help, and it containes many demos that will guide you through the process of time series modelling.
Have a go at it and keep in touch!

39th International Symposium on Forecasting

This conference just closed this evening at Thessaloniki (Greece). A big event with a lot of interesting people giving interesting talks, with a mixture of traditional greek dancing and many other exciting thigs to do / see / share.

I spoke about a library that hopefully will appear a soon as possible on the automatic identification of Unobserved Components (UC) models. The idea is as simple and as basic as saying that there are automatic identification algorithms for every sort of model around, except for UC models. However, such a simple idea is much more complex that one may think, especially if one is trying to do it in C++. The slides with preliminary results here.

SSpace tutorial

This entry is really a link to a short tutorial on how to deal in practice with SS systems with the help of SSpace in MATLAB.

SSpace is a piece of software designed to specify State Space models with a maximum of flexibility and a minimum of coding and with a lot of coding from the side of the developers that makes life much easier to the users. The tutorial is here.

M4 Conference

I just have been to this remarkable conference, that is a sort of spin-off of the M4 competition. It has been really nice, mainly because of the people involved and the high level of the talks. We had the chance to see how people from industry (big ones, actually, Amazon, Google, Microsoft, Uber and SAS) deal with the problem of forecasting in different contexts, as well as notorious academics.
The winners of the competition explained their methods and people from this big companies explained how their day-by-day forecasting problems look like. It was interesting to see how some of the presenters spoke of statistical or classical methods as opposed to Machine Learning or AI methods. The organizers did a great work in making the competition as transparent as possible and actually the results of all methods finally submitted may be replicated with the software provided by the contestants, making replicability straight away. The winners were a mixture of mature and quite young people, and statistical and «new» methods. The results were then well balanced and mark the way to go if we like to improve our forecasting abilities.
The environment was very cooperative and I had the chance to see quite open minded people in both sides of the academic and industry. A big pleasure!!

SSpace published in the Journal of Statistical Software

SSpace is a MATLAB toolbox for time series modeling and forecasting in a rather flexible and powerful State Space framework. It may be downloaded from Bitbucket, but the news is that it is now published in the Journal of Statistical Software (here).

There is a lot to do still, but any potential user that gives it a try would soon realize that it is very easy to use. I would recommend running the demos from beginning to end, since they are conceived as a tutorial that drives the user through the modeling process step by step. People who are not directly interested in State Space modeling may also take advantage of the toolbox, because there are several templates for implementing many sort of usual time series models in a very flexible way. In other words, there is no need to know anything about State Space approaches to exploit fully the toolbox.

There are still more toolboxes to come soon!!

R Course at the University of Seville

I have been invited to teach the course entitled ‘Introduction to Predictive Intelligence in R with applications’ at the Economic Analysis department PhD program in the University of Seville. Coming to Seville among good friends is always I gratifying experience.

The material of the course is here for anyone interested (in Spanish). The main objective of the course is to demonstrate the usefulness and power of R in the analysis of data, both in cross-sectional problems, as in time series and prediction. A set of predictive intelligence techniques such as regression, exponential smoothing, ad-hoc models and ARIMA will be progressively analysed. The course is eminently practical, with many examples and cases to analyze. It is divided into four sessions of two hours in which a theoretical introduction will be made for each technique, to then resolve the cases proposed in R. The course is of an introductory nature, but the students who complete it will have a good starting level to extend or adapt by themselves what they have learned to their own research topics. Attendees are encouraged to submit their own case studies.


Last week I attended the ITISE2018 conference in Granada, Spain (5th International Conference on Time Series and Forecasting). It is a nice conference, not too big, quite multidisciplinary and in a rather nice setting. Attendants had also the chance to speak to really interesting people working on time series modelling and forecasting from many different perspectives, big data included. Some of the people around were first rank (Peter M Robinson or Andrew C Harvey among others are good examples).

I just gave a short talk (jointly prepared with D Villegas, M Villegas and JR Trapero) on SSpace (see slides here). This is a MATLAB toolbox for State Space modelling and forecasting in a very flexible and efficient way (it will come up soon in the Journal of Statistical Software). It has many advantages on other pieces of software about SS modelling:

  • It is free.
  • It incorporates up-to-date algorithms, models and methods on SS systems. It allows for rather general linear Gaussian models, non-Gaussian models and non-linear models.
  • The models are specified by writing a MATLAB function. In this way, the user has complete flexibility to specify the model.
  • Templates for general and particular models in SS forma are provided with the toolbox.
  • We have tried to make the toolbox as friendly as possible to the user. For example, there is only one function for filtering regardless of the type of model, this means that such function selects internally whether the model is linear-Gaussian, non-Gaussian or non-linear. Then, the user neither have to worry about the type of system is using nor select and remember the correct function name for the appropriate filtering function, reducing the risk of errors. This is just one example of many.
  • This design makes possible a full time series analysis with just a few functions with a code that is rather simple and repetitive, i.e. easy to remember. Even those who are not interested in State Space modelling would find the toolbox compelling. Function names were chosen following nemonic rules, so that the user have to remember just a few names and will be easy to locate those functions forgotten.
  • The toolbox is provided with eight examples with thorough explanations that introduce  the user to all the features of the toolbox.

In summary, a pleasant conference that gave me the opportunity to disseminate a bit the work we have done during the last years.


I have just been to the EURO2018 conference (29th European Conference on Operational Research) in Valencia (Spain). Many comments come to my mind. Firstly, Valencia is an impressive city to live and to make some sightseeing. People is really, really friendly and lively (and lovely). Secondly, once more I have realized that everybody speaks about big data, big data, big data… Finally, though I did not speak about big data, people kindly listened to me, and  I received some support from listeners.

My presentation was entitled (jointly prepared with Marco A Villegas and Diego Villegas) ‘Automatic forecasting support system for business analytics applications based on unobserved components models (slides here) and basically, I tried to do three main things:

  • Publicize the use of Unobserved Components (UC) models for forecasting. In the end they are not so bad in comparison to Exponential Smoothing or ARIMA models, and actually I showed that UC are better in some cases and no worse in others.
  • Develop a general Automatic Forecasting Support System based on UC models. This is the first time that automatic identification of UC has been proposed. The idea is to fit all possible combinations of trend, seasonal and irregular sensible models and select the one with the smallest BIC. I am sure this procedure sounds familiar to many people.
  •  Make a thorough comparison among methods and different implementation of each methods. In particular, two implementations of Exponential Smoothing, three of ARIMA, two naive and obviously, the UC. For the database we used the UC was the best.

I do not pretend to say that UC are going to be the best in absolute every situation. The argument is no more than stating that UC models are no worse than other well stablished methods. And they have been around for a while but very little used in forecasting (check any forecasting competition or in general the forecasting literature).

In all this stuff, SSpace plays an essential role. SSpace is a MATLAB toolbox (it will come out soon published in the Journal of Statistical Software) for general and flexible State Space models. Please, feel free to download it from here and try it out.

A second presentation in which I participated (and presented by Juan R. Trapero, check out here) was entitled ‘Implementation of exponential smoothing forecasting method in a GPU for big data problems’. He showed that the use of GPUs is the way to go in forecasting applications when massive databases ought to be forecast. The advantages in computation time are impressive in big data problems. It was interesting to check that many people became interested straight away. We hope this materializes in something else than just interest, but that is another story I will tell you in the near future…

Conferencia en la Universidad Complutense de Madrid

Ayer estuve en la Complutense dando la charla titulada «Inteligencia predictiva a través de modelos de Espacio de los Estados y otras consideraciones» (las diapositivas, un poco crípticas, están aquí). Se trata de una charla en el Master Universitario de Economía que se imparte la Facultad de Ciencias Económicas y Empresariales. Pretendía extender un poquito lo que los alumnos habían visto en la docencia reglada del master con los modelos de Espacio de los Estados, con la intención de abrir horizontes a la gente joven que se está iniciando en el mundo de la investigación y laboral. Además se mostró muy brevemente cómo funciona la toolbox de Matlab conocida como SSpace, muy interesante para todo aquel que tenga que lidiar con el análisis de series temporales (descargable aquí)

La segunda parte versó sobre una colección de pensamientos desordenados sobre la que se nos viene encima con los temas de Big Data, Deep Learning, etc. y cómo puede cambiar (está cambiando) el panorama de la investigación en Economía.

Fue una ocasión muy interesante para ver a conocidos y compartir muchos comentarios durante y después del evento. Especiales gracias a Alfredo García Hiernaux por asistir y sobre todo a Antonio Jesús Sánchez Fuentes por la invitación.