nowcasting finnish economic activity: a machine learning ... · 16th may 2019 paolo fornaro and...

30
Nowcasting Finnish economic activity: a machine learning approach Paolo Fornaro and Henri Luomaranta ETLA Statistics Finland paolo.fornaro@etla.fi 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1 / 30

Upload: others

Post on 23-Jul-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Nowcasting Finnish economic activity: a machinelearning approach

Paolo Fornaro and Henri Luomaranta

ETLAStatistics Finland

[email protected]

16th May 2019

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1 / 30

Page 2: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Overview

Joint project by Statistics Finland and ETLA, within the ESSnet bigdata working group (Eurostat).

Study the potential of big data (or in general new data sources) andnew methodologies, in statistical production.

We concentrate on providing early estimates of economic activityindicators.

Now published online as experimental statisticsNowcast example

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 2 / 30

Page 3: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Overview

Current estimates of real economic activity have a 45 days (TIO) and60 days (GDP) publication lag.

Our objective is to reduce the publication lag to around 16 days.

We provide flash estimates for both TIO, the monthly indicator ofeconomic activity, and GDP (both y-on-y growth).

We use micro- (firm) level data, in combination with a large set ofstatistical models and machine learning techniques.

We also check the potential of tra�c data.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 3 / 30

Page 4: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Previous works

Nowcasting and the production of fast indicators of economic activityhave been the subject of a large literature.

Examples are Aruoba, Diebold and Scotti (2009), the EUROCoin byAltissimo et al. (2010) and Giannone, Reichlin and Small (2008).

A recent example for Finland, is the BoF large bayesian VAR-basednowcasting framework (see Itkonen and Juvonen, 2017).

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 4 / 30

Page 5: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

A word on the statistical framework (1)

We adopt a large number of models and specifications, around 130.

Factor models (Stock and Watson, 2002), shrinkage- based models(e.g. ridge regression and the lasso), boosting, regression trees,random forests, neural network etc.

For each model we estimate a specification based on raw data and 3based on di↵erent sets of principal components extracted from thepredictors.

Models are implemented using the caret package in R.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 5 / 30

Page 6: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

A word on the statistical framework (2)

We test these models, and select a subset (around 20) based on theirhistorical performance. We keep models providing unbiased estimatesof TIO year-on-year growth, i.e. models producing low mean errors.

We then use a simple nowcast’ combination framework to obtain theestimate of TIO.

The TIO estimates are used to compute the GDP ones.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 6 / 30

Page 7: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Set of predictors

Our main set of predictors is obtained from the Sales Inquiry ofStatistics Finland.

This is a monthly firm-level dataset, that comprises around 2000firms, which represent 70% of the business sector’s turnovers.

This data includes a log of when the firms’ sent their figures, allowingus to make an accurate representation of the data accumulation.

The other main data source is heavy vehicles tra�c volumes, obtainedfrom the Tra�c Agency webpage. These are available daily, with 1day publication lag.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 7 / 30

Page 8: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Tra�c data (1)

The tra�c volumes are obtained by aggregating vehicles passages,observed by automatic measurement points located around Finland.

In this application, we have focused on points located in the Helsinkiregion (around 100)

We have information regarding each passing vehicle, including speedand, importantly, vehicle type.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 8 / 30

Page 9: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Tra�c data (2)

The data is arranged on the website by region-year.

For example, all daily data for year 2018 and all measurement pointsin region 1 can be found atData example

Each file contains info for a single day-measurement point.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 9 / 30

Page 10: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Tra�c data (3)

Figure: Tra�c data example for a single day. Type of vehicle is reported incolumn K.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 10 / 30

Page 11: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Tra�c data (5)

We first sum trucks’ passages to obtain a daily indicator for eachmeasurement point.

We then average over the days of the month.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 11 / 30

Page 12: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Tra�c (6)

Time

Serie

s 1

2000 2005 2010 2015

−3−2

−10

12

TIO

Factor

(a) TIO year-on-year growth and first principal component extracted fromtra�c data. Cor=0.80

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 12 / 30

Page 13: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Other predictors

We have also tried other predictors.

VAT data, confidence indices and wages data. These did not improveresults.

In the current iteration we also include lags of TIO.

We have merged the tra�c dataset with the firm-level data, but it didnot improve the nowcasting performance.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 13 / 30

Page 14: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Empirical exercise formulation

The exercise is in pseudo-real time, i.e. we take into account thepublication lag and the original vintages of the data.

We evaluate our models against the first estimate of TIO and thet + 60 estimate of GDP. This is because they do not containadjustments due to smoothing and benchmarking. For both cases, wenowcast their year-on-year growth rates.

Our monthly nowcast go from March 2012 until December 2018. ForGDP, we compute flash estimates from 2012:Q2 until 2018:Q4.

We compute the nowcasts at t + 16 because it’s the o�cial deadlinefor the firms to send their data.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 14 / 30

Page 15: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Empirical exercise formulation (2)

We create 3 estimates of GDP: during the second month of thequarter, during the third month and at 16 days after the end of thequarter.

We use the latest estimate of TIO and use an automated ARIMA tocompute the remaining months of the quarter.

We then take the average of the growth of estimated TIO to create aflash estimate of GDP.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 15 / 30

Page 16: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Time line for TIO

t

End ofreferencemonth

t+16

Firm dataavail-

able/nowcast

t+45

O�cialpublication

Figure: O�cial release and nowcast schedule for the TIO.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 16 / 30

Page 17: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Time line for GDP

Start ofquarter

t-45

1st Nowcast

t-15

2ndNowcast

t

End ofquarter

t+16

3rdNowcast

t+60

O�cialpublication

Figure: O�cial release and nowcast schedule for quarterly GDP.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 17 / 30

Page 18: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

An example

Suppose we are using a simple factor-augmented regression tocompute the flash estimate of TIO for March 2018 (denoted t). Wewould produce the estimate on April 16th.

We would extract the factors from our firm-level dataset containingMarch sales. Denote the estimated factors bF

t

.

We then estimate TIOt

= bF 0t

� + ✏t

, using data until t � 1.

The estimate of TIO is given by dTIOt

= bF 0t

b�.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 18 / 30

Page 19: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Continuing the example

Assume we have computed the TIO for March 2018.

We would then use the Statistics Finland estimates for January andFebruary 2018, and our estimate for March.

We would take the average of the year-on-year growth over thesethree months to get Q1 GDP growth estimate.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 19 / 30

Page 20: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Target variables

Time

TIO

2000 2005 2010 2015

−10

−50

510

(a) TIO year-on-year growth,monthly series

Time

V12000 2005 2010 2015

−10

−50

5

(b) GDP year-on-year growth,quarterly series

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 20 / 30

Page 21: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Empirical results TIO, firm-level data

Time

TIO

2012 2013 2014 2015 2016 2017 2018 2019

−4−2

02

4

TIONowcast

Figure: First version of TIO year-on-year growth and nowcasts combination, usingthe unweighted average of models selected based on low mean errors.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 21 / 30

Page 22: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Empirical results TIO, based on firm-level data

Lowest ME Lowest RMSE Lowest MAE Lowest MaxE Combination ARIMAME -0.00 -0.25 -0.25 -0.25 -0.01 0.11MAE 1.06 0.75 0.75 0.75 0.78 1.36RMSE 1.35 0.95 0.95 0.95 0.96 1.79MaxE 4.60 2.17 2.17 2.17 2.52 5.85

Table: ME, MAE, RMSE and MaxE for di↵erent nowcasting models. The set ofpredictors is based on firm-level turnovers.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 22 / 30

Page 23: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Empirical results TIO, based on firm-level data

In this case, the nowcasts with the lowest MAE RMSE and maximumabsolute error are obtained from a boosting technique (with factors asinputs).

Still, a simple nowcasts’ combination gives similar results, with alower mean error (so unbiased nowcasts).

Moreover a combination approach should give a more consistentperformance over time. We focus on combinations from now on.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 23 / 30

Page 24: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Empirical results TIO, our nowcasts against final value

Combination Statistics Finland’s firstME -0.03 -0.03MAE 1.15 0.95RMSE 1.50 1.20MaxE 4.19 3.64

Table: ME, MAE, RMSE and MaxE for the nowcast combination approach andfor the Statistics Finland’s first publication of TIO. The target is the latestavailable version of the year-on-year growth of TIO.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 24 / 30

Page 25: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Empirical results TIO, based on tra�c data

Combination vs. First Combination vs. FinalME -0.07 -0.09MAE 0.86 1.19RMSE 1.09 1.58MaxE 3.16 4.44

Table: ME, MAE, RMSE and MaxE for the nowcast combination approach,evaluated using the first version of TIO growth and its latest available version.Theset of predictors is based on trucks’ tra�c volumes.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 25 / 30

Page 26: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Empirical results GDP, based on firm-level data

Time

GDP

2012 2013 2014 2015 2016 2017 2018 2019

−2−1

01

23

GDPNowcast

(a) Nowcasts during second month.

Time

GDP

2012 2013 2014 2015 2016 2017 2018 2019−2

−10

12

3

GDPNowcast

(b) Nowcasts during third month.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 26 / 30

Page 27: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Empirical results GDP, based on firm-level data

Time

GDP

2012 2013 2014 2015 2016 2017 2018 2019

−2−1

01

23

GDPNowcast

Figure: Nowcasts 16 days after quarter.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 27 / 30

Page 28: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Empirical results GDP, based on firm-level data

Nowcast second month Nowcast third month Nowcasts 16 days after StatFi FlashME 0.24 0.03 0.00 -0.04MAE 0.82 0.66 0.50 0.50RMSE 1.00 0.85 0.63 0.64MaxE 2.13 1.86 1.15 1.45

Table: ME, MAE, RMSE and MaxE for the nowcast combination approach,evaluated using the first version of quarterly GDP year-on-year growth. The set ofpredictors is based on firms’ sales.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 28 / 30

Page 29: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Empirical results GDP, based on tra�c data

Nowcast second month Nowcast third month Nowcasts 16 days after StatFi FlashME 0.17 0.07 -0.01 -0.04MAE 0.83 0.66 0.51 0.50RMSE 0.99 0.85 0.66 0.64MaxE 2.07 1.95 1.43 1.46

Table: ME, MAE, RMSE and MaxE for the nowcast combination approach,evaluated using the first version of quarterly GDP year-on-year growth. The set ofpredictors is based on trucks’ tra�c volumes.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 29 / 30

Page 30: Nowcasting Finnish economic activity: a machine learning ... · 16th May 2019 Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 1/30. Overview Joint

Conclusions

Our nowcasting approach provides competitive predictions of TIO andGDP.

At a monthly frequency, firm-level data provide slightly betternowcasts, compared to tra�c volumes.

For GDP, both firm-level and tra�c volumes based nowcasts provideaccurate estimates.

Tra�c data should be studied further, given their availability.

Paolo Fornaro and Henri Luomaranta (Etla ) Nowcasting Finnish economy 16th May 2019 30 / 30