USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1:...

22
USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research

Transcript of USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1:...

Page 1: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

USING DEMETRA+ IN DAILY WORK

SAUG – Luxembourg, 16 October 2012Enrico INFANTE, EurostatUnit B1: Quality, Methodology and Research

Page 2: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

2

Summary

Price Series– Price Volatility Analysis

Production Series– Seasonal Adjustment– SARIMA Forecasts– Current vs. Concurrent Adjustment– Direct vs. Indirect approach

• IB test– In the future…

SAUG – Luxembourg, 16 October 2012 Enrico Infante

Page 3: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

3

The study is conducted on Italian food and agricultural data

SAUG – Luxembourg, 16 October 2012 Enrico Infante

Price Volatility Analysis

PRICE SERIES

Price Volatility Analysis

Page 4: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

4

How many series?

SectorPrice Volatility

Analysis

Milk 1

Butchering 10

Agro-food 48

Ichthyic 12

Total 71

SAUG – Luxembourg, 16 October 2012 Enrico Infante

Price Volatility Analysis

Page 5: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

5

Price Volatility Analysis

The basic idea is to check whether the price of a determined product in a determined period is outside the expected trend. The procedure follows three main steps:

1.Model the series without the last three observations using a SARIMA(p,d,q)(P,D,Q)

2.Using the model identified during step 1 to produce forecast intervals for the three observations not considered in step 1

3.Check whether the price observed is inside or outside the forecast interval

If the price observed is outside the interval, then there is high volatility

SAUG – Luxembourg, 16 October 2012 Enrico Infante

Page 6: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

6

The procedure is the follow

SAUG – Luxembourg, 16 October 2012 Enrico Infante

heVARzhx nn 2ˆ

Price Series

SARIMA model without

3 obs.

Forecast intervals

Detect the volatility degree

Price Volatility Analysis

Page 7: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

7

Example: Parmigiano Reggiano and Grana Padano

There is low volatility for the "Grana Padano", as the observed price is in the forecasted interval

There is high volatility for the "Parmigiano Reggiano", as the observed price is not within the forecasted interval

SAUG – Luxembourg, 16 October 2012 Enrico Infante

Price Volatility Analysis

Page 8: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

8

Special cases (e.g. fruit)

In some cases (typically for the fruit series) there are data just for a certain period of the year. In these cases the available data are considered consecutive, and no seasonal and/or calendar effects are considered

SAUG – Luxembourg, 16 October 2012 Enrico Infante

Price Volatility Analysis

Page 9: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

9

The study is conducted on Italian food and agricultural data

SAUG – Luxembourg, 16 October 2012 Enrico Infante

Seasonal Adjustment

Forecast

Direct/Indirect approach

Current/Concurrent AdjustmentPRODUCTION

SERIES

Seasonal Adjustment

Page 10: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

10

How many series?

Sector SA and Forecast

Milk 5

Butchering 21

Ichthyic 1

Import/Export Agro-food 99

Import/Export Ichthyic 20

Total 145

SAUG – Luxembourg, 16 October 2012 Enrico Infante

Seasonal Adjustment

Page 11: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

11

Seasonal Adjustment

The series are seasonally adjusted following the ESS guidelines

A knowledge of the sectors is a key part for modelling outliers, calendar effects, etc.

The series are modelled using the TRAMO/SEATS modules of Demetra+

The models detected from the automatic procedure (RSA4) are modified, when necessary, in order to get better results

If necessary, the earliest years are removed from the model

SAUG – Luxembourg, 16 October 2012 Enrico Infante

Page 12: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

12

SARIMA Forecasts

The study focuses on the forecasts of the series The first step is to identify the SARIMA model

Demetra+ forecasts The forecasts are sometimes "adjusted" basing on

qualitative information Example: Milk

The total milk produced in Italy is more or less the same amount for every production year (from April to March). So the values obtained from Demetra+ are adjusted in order to get the same total (10883,073)

SAUG – Luxembourg, 16 October 2012 Enrico Infante

Page 13: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

13

Current vs. Concurrent Adjustment

The way in which Seasonal Adjustment is carried out has implications for the revisions of seasonally adjusted data

There are monthly series that are updated every quarter, so each quarter there are 3 new observations

Usually there are no revisions on the series, and even if there are some, they are very small

SAUG – Luxembourg, 16 October 2012 Enrico Infante

Page 14: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

14

Current vs. Concurrent Adjustment

A partial Concurrent Adjustment strategy is chosen, with an update of the parameters coefficient and outliers in the last year

SAUG – Luxembourg, 16 October 2012 Enrico Infante

The main issue arises when the chosen model does not produce good forecasts, even if the model seems to be good. In that case the model is re-estimated in order to get better results in terms of forecasts

Page 15: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

15

Direct vs. Indirect approach

Some series are aggregated at different levels In order to decide which approach to follow, an a priori

test has been used The main advantage of using an a priori test is that the

choice is made on statistical bases without running any seasonal adjustment procedure

The test used is the so-called IB test, that is in line with the ESS guidelines on Seasonal Adjustment: when the series composing the aggregate have common similar seasonal patterns, a Direct approach would be used

The test is performed using R scripts

SAUG – Luxembourg, 16 October 2012 Enrico Infante

Page 16: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

16

Direct vs. Indirect approach – IB test

The basic idea of the IB test is stated in Infante and Buono (2012)

The classic test for moving seasonality is based on a 2-way ANOVA test, where the two factors are the time frequency (usually months or quarters) and the years. This test is based on a 3-way ANOVA model, where the three factors are the time frequency, the years and the series

The variables tested are the de-trended series, where the trend is determined by applying a Hodrick-Prescott filter for each series

The notation SI is kept for remarking the fact that it is a de-trended series

HPijkijkijk TXSI

SAUG – Luxembourg, 16 October 2012 Enrico Infante

Page 17: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

20

Direct vs. Indirect approach – IB test

The null hypothesis is made by taking into consideration that there is no change in seasonality over the series

The test statistic is the ratio of the between series variance and the residual variance, and it follows a Fisher-Snedecor distribution with (S-1) and (MNS-1)-(M-1)-(N-1)-(S-1) degrees of freedom

Rejecting the null hypothesis is to say that the pure Direct Approach should be avoided, and an Indirect Approach should be considered

1111;12

2

~ SNMMNSSR

ST F

S

SF

ScccH 210 :

SAUG – Luxembourg, 16 October 2012 Enrico Infante

Page 18: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

21

Direct vs. Indirect approach – IB test

An example: butchering pork

SAUG – Luxembourg, 16 October 2012 Enrico Infante

Page 19: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

22

Direct vs. Indirect approach – IB test

An example: butchering pork

SAUG – Luxembourg, 16 October 2012 Enrico Infante

VAR Mean Square df

Months 4.818.439.366 11

Years 1.135.483.533 10

Series 141.362.592.258 2

Residual 1.054.706.450 384

134.0303F

0000.0 valueP

There is no evidence of common seasonal patterns between the series at 5 per cent level

An Indirect approach is recommended

Page 20: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

23

In the future…

From Demetra+ to Jdemetra+!!!

SAUG – Luxembourg, 16 October 2012 Enrico Infante

Page 21: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

24

In the future…

SAUG – Luxembourg, 16 October 2012 Enrico Infante

Assessment for residual seasonality

•Additive aggregate

•What if the aggregation function is different?

Test a priori

Java code

(older version)

R code

Page 22: USING DEMETRA+ IN DAILY WORK SAUG – Luxembourg, 16 October 2012 Enrico INFANTE, Eurostat Unit B1: Quality, Methodology and Research.

25

Questions

Many thanks for your attention!!!

SAUG – Luxembourg, 16 October 2012 Enrico Infante

Your questions and comments are very welcome!