26
Testing seasonal Testing seasonal adjustment with adjustment with Demetra+ Demetra+ Petrenko I.S. State Statistics Service of Ukraine

Testing seasonal adjustment with Demetra +

Embed Size (px)

DESCRIPTION

Testing seasonal adjustment with Demetra +. Petrenko I.S. State Statistics Service of Ukraine. 2. 3. 4. 5. 6. The number of working days. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. - PowerPoint PPT Presentation

Citation preview

Page 1: Testing seasonal adjustment with Demetra +

Testing seasonal adjustment Testing seasonal adjustment withwith Demetra+Demetra+

Petrenko I.S.State Statistics Service of Ukraine

Page 2: Testing seasonal adjustment with Demetra +

Demetra + the latest programme version was downloaded in May 2011 from:http://forge.osor.eu/frs/download.php/1549/demetra_plus_1.0.2.msi

Time series data of the index of industrial production of Ukraine with year 2005, was used for the seasonal adjustment with Demetra + .(NACE rev.1.1)(IPP)

2

Page 3: Testing seasonal adjustment with Demetra +

Check the original time series• The length of time series: [1-2000: 9-2011] or 141 observations.• Accuracy: information received from enterprises is passing logical and arithmetic control (by using software) and corrects in the case of errors, the following data processing is carried out with amends; reference year indexes are published with taking into account the amends, data analysis and revision for the last year carried out in February.• Input data quality:- the outliers were checked, no missing values .• Quality of the methods of data compliation:- A monthly series for the 2006-2011 year were obtained by the new method (see reference).• The sequence of the time series:- Based on the indexes of the previous month, the index for December 1999 is calculated with the linking method(two parts of series are joined: 2000-2005 and 2006-2011), monthly average of 2005 year was received and monthly data series for 2005 year were formed.

Reference: For 2000-2008, IPP calculation was carried out using the linking method based on the monthly index, calculated according to the companies data based on the monthly production value in constant prices. From 2009, the calculation based on the dynamics of production data with a permanent set of representative goods (more than 1000 positions) and gross added value structure (2007 base year), that corresponds to international standards in this area. Indixes for 2007 and 2008 years were recalculated with the new methodology.

3

Page 4: Testing seasonal adjustment with Demetra +

Visual analysis of original time series

4

Page 5: Testing seasonal adjustment with Demetra +

Seasonal chart of industrial production of Ukraine

Index for March, is often higher than the index in January or February.The highest production average value in October.

Spectrum analysisThe presented diagram of auto-regressive spectrum at zero frequency shows the highest point in all the seasonal frequencies (grey lines), this is indicating the presence of seasonality (regular composition) in the original data. 5

Page 6: Testing seasonal adjustment with Demetra +

Calendar preparation. The choice of approach and regressors.

State calendar of Ukraine was prepared with Demetra + Calendar effectsDifferent number of days in the month and working days, various holidays (New Year, Christmas, national holidays), including movable (Easter, Trinity) - have an influence on the times series of IPP Of Ukraine. Usually, many national holidays in May.

Reference: Industry of Ukraine is represented by different activities (in total more than 150 - at the level of 3-4 mark NACE). Determining impact on the dynamics - has (more than 50% of added value): metallurgy industry (continuous production cycle is highly dependent on foreign markets), food industry (in general, well developed, the most seasonal: sugar industry (October), confectionery industry and alcoholic beverages industry (December), brewing (summer)), engineering industry (including industries with a long production cycle: aircraft and shipbuilding industry, heating boiler building, engines and turbines), chemical and petrochemical industry. Influential: mining industry, electric power industry, oil-refining industry (continuous-cycle fabrication).

TRAMO/SEATS (исходя из рекомендаций)Использована спецификация, которая создана на основе спецификации RSA5 и национального календаря

6

Page 7: Testing seasonal adjustment with Demetra +

7

jan feb mar apr may jun jul aug sep oct nov dec Average

2000 19 21 22 20 19 20 21 22 21 22 22 21 20,8

2001 21 20 21 20 20 19 22 22 20 23 22 21 20,9

2002 21 20 20 22 19 18 23 21 21 23 21 22 20,9

2003 21 20 20 21 19 19 23 20 22 23 20 23 20,9

2004 20 20 22 21 17 21 22 21 22 21 22 23 21,0

2005 19 20 22 21 19 20 21 22 22 21 22 22 20,9

2006 20 20 22 19 20 20 21 22 21 22 22 21 20,8

2007 21 20 21 20 19 20 22 22 20 23 22 21 20,9

2008 21 21 20 21 19 19 23 20 22 23 20 23 21,0

2009 20 20 21 21 18 20 23 20 22 22 21 23 20,9

2010 19 20 22 21 17 21 22 21 22 21 22 23 20,9

2011 19 20 22 20 19 20 21 22 22 21 22 22 20,8

2012 20 21 21 20 20 19 22 22 20 23 22 21 20,9

Average 20,1 20,2 21,2 20,5 18,8 19,7 22 21,3 21,3 22,2 21,5 22,0  

The number of working days

Page 8: Testing seasonal adjustment with Demetra +

The applied modelsPre-processing information:

• estimation span: [1-2000 : 9-2011]• series has been log-transformed• number of effective observations = 128• number of estimated parameters = 14• the working day and Easter calendar effects were checked• a leap year influence was tested • Demetra+ indentified as the most suitable model of the airline

ARIMA model [(0,1,1)(0,1,1)]

• the procedure of deviating values determination, indentified 3 deviating values in the series:

– a level shift in October and November 2008– an additive outlier in December 2004

Parameter Value Std error T-stat P-value

LS[10-2008] -0,1750 0,0227 -7,70 0,0000

LS[11-2008] -0,1225 0,0227 -5,39 0,0000

AO[12-2004] -0,0616 0,0170 -3,63 0,0004

8

Page 9: Testing seasonal adjustment with Demetra +

The applied models

9

Number of values above the central value: 64 Number of values below the central value: 64 Runs: 69

Test Value P-Value Distribution Number 0,7099 0,4778 Normal(0,00;1,00) Length 3,3750 1,0000 Chi2(128)

Up and down runs: 86

Test Value P-Value Distribution Number 0,2111 0,8328 Normal(0,00;1,00) Length 3,7060 1,0000 Chi2(127)

Page 10: Testing seasonal adjustment with Demetra +

The applied modelsInformation about Decomposition:

Trend. Innovation variance = 0,1360Seasonal. Innovation variance = 0,0466Irregular. Innovation variance = 0,1980

The original time series of IPP is a product of its components: seasonal*trend*irregular

Check the accuracy of the decompositionCross-corellation results: The variance of seasonal and trend

components is lower than fluctuation of irregular component.It means that trend and seasonal components are stable.

Estimator Estimate PValue

trend/seasonal -0,1130 -0,1538 0,6695

trend/irregular -0,0347 -0,0717 0,7404

seasonal/irregular 0,0403 0,0463 0,8898

10

Page 11: Testing seasonal adjustment with Demetra +

Graphs of the results

Lower graph shows the seasonal factor (blue) and the irregular component (red) and their in time development. Seasonal series fluctuations are significant, as the seasonal component is not lost in the noise of non-standard component (seasonal fluctuations amplitude is much higher than irregular component fluctuations). In the same time there is an amplitude  decrease of seasonal fluctuations (since 2005).

11

Page 12: Testing seasonal adjustment with Demetra +

Graph of the resultsComponents of the index of industrial production of Ukraine (2005 = 100)

 

 

50556065707580859095

100105110115120

Jan-

00

Jan-

01

Jan-

02

Jan-

03

Jan-

04

Jan-

05

Jan-

06

Jan-

07

Jan-

08

Jan-

09

Jan-

10

Jan-

11

%

Первичная составляющая

50556065707580859095

100105110115120

Січ

.00

Січ

.01

Січ

.02

Січ

.03

Січ

.04

Січ

.05

Січ

.06

Січ

.07

Січ

.08

Січ

.09

Січ

.10

Січ

.11

%

Сезонная составляющая

50

55

60

65

70

75

80

85

90

95

100

105

110

115

120

Jan-

00

Jan-

01

Jan-

02

Jan-

03

Jan-

04

Jan-

05

Jan-

06

Jan-

07

Jan-

08

Jan-

09

Jan-

10

Jan-

11

%

Нерегулярная составляющая

50

55

6065

70

75

8085

90

95

100

105110

115

120

Січ

.00

Січ

.01

Січ

.02

Січ

.03

Січ

.04

Січ

.05

Січ

.06

Січ

.07

Січ

.08

Січ

.09

Січ

.10

Січ

.11

%

Тренд-цикл

12

Page 13: Testing seasonal adjustment with Demetra +

Check for moving seasonalityGraph ratio Seasonality-Irregularity

Allows clearly analyze the curve of seasonal fluctuations.Variable seasonal fluctuations are defined in October . As well as in December.

13

Page 14: Testing seasonal adjustment with Demetra +

Quality controlFinal diagnostics, that estimates the quality of adjustment (Main results)

The analysis was carried out with all kinds of diagnostics, with the result of visual evaluation of the spectral peaks.

The basic test:- The value obtained as a result of the comparison of the annual totals of the original series and the series adjusted for seasonal variations is as close to zero as required.

Visually, the spectral analysis: the final diagnosis of seasonal variations and the effects of operating days in a row, adjusted for seasonal variations are absent.

Regarima residuals (not (by definition) to include data): The residuals follow a normal distribution, are independent and random (slide 9 and 14).

Residual seasonality: not found seasonal variations in the remaining series adjusted for seasonal variations and irregular component.

14

Page 15: Testing seasonal adjustment with Demetra +

Quality controlResidual seasonal factor

The spectrum graphs of seasonally adjusted series

We can assume that there are no indicators of residual seasonal fluctuations in the seasonally adjusted series: the seasonal frequency (gray vertical lines) and at the trading day frequency (purple) no spectral peaks found, these indicate the absence of seasonal fluctuations and trading day effects in the seasonally adjusted series.

15

Page 16: Testing seasonal adjustment with Demetra +

Quality control

Residual seasonality:

The graph of a spectrum of residuals

16

Page 17: Testing seasonal adjustment with Demetra +

Quality control

Results of seasonality test:Non parametric tests for stable seasonality

Friedman test

Friedman statistic = 151,4086 Distribution: F-stat with 11 degrees of freedom in the numerator and 110 degrees of freedom in the denominator P-Value: 0,0000 Stable seasonality present at the 1 per cent level Kruskall-Wallis test Kruskall-Wallis statistic = 129,8260 Distribution: Chi2(11) P-Value: 0,0000 Stable seasonality present at the 1 per cent level Test for the presence of seasonality assuming stability

Sum of squares degrees of freedom

Mean square

Between months 0,3141 11 0,0286 Residual 0,0208 129 0,0002 Total 0,3349 140 0,0024

Value: 177,0271 Distribution: F-stat with 11 degrees of freedom in the numerator and 129 degrees of freedom in the denominator P-Value: 0,0000 Seasonality present at the 1 per cent level Evolutive seasonality test

Sum of squares Degrees of freedom

Mean square

Between years 0,0012 10 0,0001 Error 0,0181 110 0,0002

Value: 0,7401 Distribution: F-stat with 10 degrees of freedom in the numerator and 110 degrees of freedom in the denominator P-Value: 0,6854 No evidence of moving seasonality at the 20 per cent level Combined seasonality test

Identifiable seasonality present Residual seasonality test

No evidence of residual seasonality in the entire series at the 10 per cent level: F=0,5676 No evidence of residual seasonality in the last 3 years at the 10 per cent level: F=0,6547

17

Тест Фридмана Статистика Фридмана = 151,4086 Распределение: F-статистика со степенью свободы 11 в числителе и со степенью свободы 110 в знаменателе P-величина: 0,0000 Стабильные сезонные колебания присутствуют на 1% уровне Тест Крускаля-Уоллиса Статистика Крускаля-Уоллиса = 129,8260 Распределение: Chi2 (11) P-величина: 0,0000 Стабильные сезонные колебания присутствует на 1% уровне Тест на присутствие стабильных сезонных колебаний Сумма квадратов Степень свободы Средний квадрат Между месяцами 0,3141 11 0,0286 Остаткиl 0,0208 129 0,0002 Всего 0,3349 140 0,0024

Величина: 177,0271 Распределение: F-статистика со степенью свободы 11 в числителе и со степенью свободы 129 в знаменателе P-величина: 0,0000 Сезонные колебания присутствуют на 1% уровне Тест на развивающие сезонные колебания

Сумма квадратов Степень свободы Средний квадрат

Между годами 0,0012 10 0,0001 Ошибка 0,0181 110 0,0002

Величина: 0,7401 Распределение: F-статистика со степенью свободы 10 в числителе и со степенью свободы 110 в знаменателе P-значение: 0,6854 Отсутствуют скользящие сезонные колебания на 20% уровне Комбинированный сезонный тест Присутствуют идентифицируемые сезонные колебания Тест на остаточный сезонные колебания Отсутствуют показания остаточных сезонных колебаний во всем ряду 10% уровне: F = 0,5676 Отсутствуют показания остаточных сезонных колебаний за последние 3 года на 10% уровне: F = 0,6547

Page 18: Testing seasonal adjustment with Demetra +

Quality controlStability of model/updates analysis:

Graphics 1 and 2: Revision history indicates stability of adjustment

Subwindow graphic of seasonal fluctuations adjusted series shows consistent estimates for the 2008-1 period. From the subwindow graph we can see that after the 2nd year the revisions are not essential. A sudden change in the estimation (seasonal fluctuations adjusted), in October or November 2008, happens due to a level shift (an outlier).

18

Page 19: Testing seasonal adjustment with Demetra +

Quality controlStability of the model/analysis of the updates:

19

Page 20: Testing seasonal adjustment with Demetra +

Quality controlStability of model/sliding spans:

The program has set four eight-year time intervals (from the length of IPP series), and compares the changes of levels of seasonality and operating days components.

According to the analysis of the sliding spans of the seasonal component, we can assume that the seasonal factors of industrial production of Ukraine are stable, as neither of the relative estimates exceeds 3% (threshold of the abnormal values fixed by programme).

Sliding spans summary

Time spans

Span 1: from 1-2000 to 9-2008 Span 2: from 1-2001 to 9-2009 Span 3: from 1-2002 to 9-2010 Span 4: from 1-2003 to 9-2011 Tests for seasonality Span 1 Span 2 Span 3 Span 4 Stable seas. 102,7 112,9 168,3 207,8 Kruskal-Wallis 92,2 94,4 97,0 97,9 Moving seas. 1,5 1,0 1,1 0,9 Identifiable seas. YES YES YES YES

Means of seasonal factors Span 1 Span 2 Span 3 Span 4 January 0,9092 0,9058 0,9124 0,9160 February 0,9188 0,9186 0,9203 0,9198 March 1,0153 1,0149 1,0179 1,0187 April 0,9894 0,9870 0,9909 0,9872 May 0,9779 0,9787 0,9788 0,9826 June 0,9872 0,9907 0,9885 0,9836 July 1,0146 1,0166 1,0164 1,0169 August 1,0048 1,0055 1,0058 1,0090 September 1,0112 1,0136 1,0102 1,0078 October 1,1011 1,0916 1,0785 1,0741 November 1,0418 1,0403 1,0381 1,0366 December 1,0358 1,0387 1,0435 1,0481

20

Page 21: Testing seasonal adjustment with Demetra +

Quality controlModel stability diagnostics:

The graph shows the unstable parameter (from negative to positive) of the regular moving-average, but the seasonal moving-average parameter evolves within the small values , that indicates its stability.

21

Page 22: Testing seasonal adjustment with Demetra +

Quality controlDiagnostics/Stability of the model:

22

Page 23: Testing seasonal adjustment with Demetra +

23

Quality controlTest statistics and residuals curve:

Residuals diagnostic tests did not show evidence of statistical problems. Residuals are random, normal and independent. According to the results of tests for linearity, the residuals do not show the nonlinearity in the form of trends. Series do not show significant or positive autocorrelation, seasonal fluctuations do not occur.

Page 24: Testing seasonal adjustment with Demetra +

24

Assess possibilities to publish the results

Based on the current practice in Ukraine and on the IPP data review, as well as received recommendations, we suggest:Web-site publishing:(1) the schedule of a series of index data for the reference year (for example: for the last 5 years):• input data;• seasonally adjusted data;• trend-cycle data.(2) the series lenght of indexes data to the base year (for the whole period):• input data;• seasonally adjusted data.(3) optional: series data for the last reporting month to the previous month and matched month (to the period of the last year?)• input data;• seasonally adjusted data.Note: In addition there is a question about publishing calendar adjusted data (based on the practice of publishing data in press-releases from other countries), when this effect is significant.

We do not think that the publication in the first release is possible (release date at the 16th day after the reporting period).Necessity:• concordance of SNA data (publish seasonally adjusted series already), and industry data;• due to the change of classification (NACE rev.2, CPA 2002) and using the new base year recalculation of the IPP.Possible period: from 2013.

Page 25: Testing seasonal adjustment with Demetra +

25

Learning points

Two people were in charge of testing seasonal adjustment with Demetra+ since May, including the specialist from Index Calculating Unit (more in-depth).

The program was studied, by using the default calendar, for prolonged time. RSA5 to RSA2 specifications were used. Also, by changing the predictors, we tried to create our own specifications. We fixed on RSA4 (program selected ARIMA model [(0,1,0) (0,1,1)]) and our own specification based on RSA4 (ARIMA model [(0,1,1) (0,1 , 1)]), whose characteristics gave better results than others.We also used the shorter IPP series (2000-2007, 2006-2011).

Parallel processing was tested with other countries series data, as in Ukraine series comparision by the industry activities is correct only since 2006 (using the new method, see slide 3).

After implementing state calendar of Ukraine in the programme the results were different (see slides).

We studied everything that was proposed in the working papers about the documentation, but there are a lot of possibilities in the programme.

As much as possible, we are planning to perform a seasonal adjustment on a monthly basis, with the addition of new data in order to assimilate the whole procedure (also a policy revision, publication preparation, etc.) and increase of mathematical statistics knowledge.

Page 26: Testing seasonal adjustment with Demetra +

26

Questions to the trainers in workshop II

Prerequisites for seasonal adjustment in assessing the validity of results:- how to check?- when volatility is moderate?- when seasonal fluctuations are significant?

How to correctly use the results of nonparametric tests for seasonal fluctuations? Especially in the part of seasonality in the original series (please give your comments, if possible, using the example, IPP time series of Ukraine (or another series)).

We are interested in everything related to the calendar: from creation (whether the implemention in the program and its usins were correct) to calendar effects determination and results interpretation.

Please explain the meaning, definition and function of each option using in the specifications selecting.

How else can we use the data in tables (except for the publications and charts), how to analyze them (for example: pre-processing/regressors, etc.)?

During the workshop it is important to be sure that everything was done correctly, does the result has a right interpretation and vice versa, if we were mistaken, why it happened and how to avoid incorrect results?