JDemetra+ User Guide Version

2.2

Sylwia Grudkowska

Department of Statistics Warsaw,

2017 r.

Sylwia Grudkowska – Narodowy Bank Polski, Department of Statistics [email protected],

(+48) 22 585 92 48

The views expressed herein are those of the authors and not necessarily those of the Narodowy Bank Polski Print: NBP Printshop Published by: Narodowy Bank Polski Education & Publishing Department ul. Świętokrzyska 11/21 00-919 Warszawa, Poland phone +48 22 653 23 35 www.nbp.pl © Copyright Narodowy Bank Polski, 2017

Table of content

1. Introduction 5 1.1. Historical background 5 1.2. About JDemetra+ 7 1.3. About JDemetra+ User Guide 9 1.3.1. Who should use this document? 9 1.3.2. How the document is organized 9 1.3.3. How to use this document 10 2. Preliminary issues: uploading and visualizing data 12 2.1.1. Overview of the JDemetra+ 12 2.1.2. Source data 14 2.1.3. Import data 15 2.1.4. Displaying data 18 3. Seasonal adjustment and other -series analysis with JDemetra+ 22 3.1. Simple seasonal adjustment 23 3.1.1. Simple seasonal adjustment of single time series 23 3.1.2. Simple seasonal adjustment of multiple time series 32 3.2. Detailed seasonal adjustment 42 3.2.1. Detailed seasonal adjustment of single time series 42 3.2.2. Detailed seasonal adjustment of multiple time series 78 3.3. Time series modelling 100 3.3.1. Basic time series analysis 100 3.3.2. Advanced time series analysis 103 3.4. Other tools 112 3.4.1. Seasonality tests 112 3.4.2. Spectral graphs 121 3.4.3. 127 4. References 151

Acknowledgements:

I am deeply grateful to Veronique Elter (STATEC), Duncan Elliott and James Macey (Office for National Statistics), Jean Palate and David de Antonio Liedo (The National Bank of Belgium), Dominique Ladiray and Trong-Hien Pham (INSEE), Christiane Hofer, Andreas Dietrich and Andreas Lorenz (Deutsche Bundesbank) for their valuable support in the preparation of this document.

Thanks are to Faiz Alsuhail (Statistics Finland), Karen Keller (Statistics Denmark), Regina Soares (Statistics Portugal) and Yingfu Xie (Statistics Sweden) for their insightful comments and suggestions.

Finally, I would like to thank the all the members of the Seasonal Adjustment Centre of Excellence for their useful comments and helpful suggestions on various drafts of this document.

Disclaimer:

The JDemetra+ User Guide is provided by Eurostat. This material:

▪ is information to assist new users of JDemetra+ to familiarize themselves with the interface and functionalities of the application in a general nature and is not intended to favour one method over another out of those available in the application; ▪ is still in development; ▪ sometimes links to further papers and documents for which Eurostat has no control and for which Eurostat assumes no responsibility; ▪ does not constitute professional or legal advice.

JDemetra+ is designed to support the ESS Guidelines on Seasonal Adjustment (2015). While JDemetra+ incorporates the seasonal adjustment methods of the U.S. Census Bureau (X-12-ARIMA and X- 13ARIMA-SEATS) and of the Bank of Spain (TRAMO/SEATS), the ESS Guidelines on Seasonal Adjustment (2015) do not promote one method over another.

The paper presents the personal opinions of the author and does not necessarily reflect the official position of the institutions with whom the author cooperates. All errors are author’s responsibility.

Contact:

Sylwia Grudkowska – Narodowy Bank Polski, Department of Statistics [email protected], (+48) 22 585 92 48

4

1. Introduction

1.1. Historical background

Seasonal adjustment (SA) is an important component of the official statistics business process. This technique is widely used for estimating and removing seasonal and -related movements from time series resulting in data that a clear picture of economic phenomena. For these reasons Eurostat1 takes part in various activities that aim to promote, develop and maintain a publicly available software solution for SA in line with established best practice.

Among many seasonal adjustment methods that produce reliable results for large datasets the most widely used and recommended are X-12-ARIMA2 (X-13ARIMA-SEATS3) developed at the U.S. Census Bureau and TRAMO/SEATS4 developed by Victor Gómez and Agustín Maravall, from the Bank of Spain. Both methods are divided into two main parts. The first part is called pre-adjustment and removes deterministic effects from the series by means of a regression model with ARIMA noise. The part is the decomposition of the time series to estimate and remove a seasonal component. TRAMO/SEATS and X-12-ARIMA use a very similar approach in the first part to estimate the same model on the processing step, but they differ completely in the decomposition step. Therefore, comparing results from decomposition is often difficult. Furthermore, their diagnostics focus on different aspects and their outputs take completely different forms.

Both the above seasonal adjustment programs were originally written in FORTRAN, which is currently recognized as a declining language. The FORTRAN limitations - especially for the

1 Eurostat is the statistical office of the European Union. Its task is to provide the European Union with statistics at European level that enable comparisons between countries and regions. More information at http://epp.eurostat.ec.europa.eu/portal/page/portal/eurostat/home/. 2 X-12-ARIMA is a seasonal adjustment program developed and supported by the U.S. Census Bureau. It includes all the capabilities of the X-11 program (see Dagum, E.B.D. (1980)) which estimates trend and seasonal component using moving averages. X-12-ARIMA offers useful enhancements including: extension of the time series with forecasts and backcasts from ARIMA models prior to seasonal adjustment, adjustment for effects estimated with user-defined regressors, additional seasonal and trend filter options, alternative seasonal-trend-irregular decomposition, additional diagnostics of the quality and stability of the adjustments, extensive time series modelling and model selection capabilities for linear regression models with ARIMA errors. For basic information on the X-12-ARIMA program see X-12-ARIMA Reference Manual (2011). More information on X- 12-ARIMA can be found at http://www.census.gov. 3 X-13ARIMA-SEATS is a seasonal adjustment program developed and supported by the U.S. Census Bureau that contains two seasonal adjustment modules: the enhanced X-11 seasonal adjustment procedure and ARIMA model based seasonal adjustment procedure from the SEATS seasonal adjustment program developed by Gomez, V. and Maravall, A. (2013). For information on the X-3ARIMA-SEATS program see X-13ARIMA-SEATS Reference Manual (2013). More information on X13ARIMA-SEATS can be found at http://www.census.gov. 4 TRAMO/SEATS is a model-based seasonal adjustment method developed by Victor Gomez and Agustin Maravall (the Bank of Spain). It consists of two linked programs: TRAMO and SEATS. TRAMO ("Time Series Regression with ARIMA Noise, Missing Observations, and Outliers") performs estimation, forecasting, and interpolation of regression models with missing observations and ARIMA errors, in the presence of possibly several types of outliers. SEATS ("Signal Extraction in ARIMA Time Series") performs an ARIMA-based decomposition of an observed time series into unobserved components. Both programs are supported by the Bank of Spain. For basic information on the TRAMO/SEATS see Caporello, G., and Maravall, A. (2004). More information on TRAMO/SEATS can be found at www.bde.es.

5

creation of reusable components and for the management of complex problems - make the maintenance of the relevant IT codes increasingly burdensome.

These original seasonal adjustment programs are commonly perceived by users as difficult to operate. Therefore, to improve access to SA methods for non-specialists, Eurostat introduced new software called Demetra. It offered a user-friendly interface to the two SA algorithms: TRAMO/SEATS and X-12-ARIMA and facilitated the comparison of the output from those two algorithms. Even so, Demetra uses the FORTRAN libraries, which, together with insufficient product development and handling of errors, is a factor that caused a rapid decline in software’s usage.

In 2009, the European Statistical System (ESS) launched its Guidelines on Seasonal Adjustment5. As Demetra could not be adapted to the new requirements in the Guidelines, Eurostat, in cooperation with the National Bank of Belgium (NBB), started a project aiming to develop improved software called Demetra+6. It was released in 2012. This tool provides a common approach for seasonal adjustment using TRAMO/SEATS and X-12-ARIMA methods, which is more coherent with the Guidelines. It includes a unified graphical interface and input/output diagnostics for the two methods. Demetra+ source code is written in C++ and uses the two original FORTRAN modules, as well as .NET libraries. Therefore Demetra+ software is non-extensible and cannot be used in IT environments other than Windows. For these reasons it seems that in long- perspective it will not meet users’ expectations.

Therefore, Eurostat took an initiative to create new software that is based on Demetra+ experience but is platform independent and extensible. The resulting program is called JDemetra+ and was developed by the NBB in 2012-2014. From the typical user perspective in comparison with Demetra+, numerous improvements have been implemented in JDemetra+, in terms of both layout and functionalities. The most critical innovation is the re-writing of the original FORTRAN codes of X-12-ARIMA and TRAMO/SEATS in JAVA, following a real object-oriented approach. These functionalities are discussed in the next section.

5 Endorsed by the Statistical Programme Committee, the European Statistical System (ESS) Guidelines on Seasonal Adjustment (2009) aim to harmonize European practices and to improve the comparability of infra-annual national statistics as well as enhance the overall quality of the European Union and the euro area aggregates. The ESS Guidelines on Seasonal Adjustment (2009) and its revised version released in 2015 cover all the key steps of the seasonal and calendar adjustment process. They discuss both the theoretical aspects and practical implementation of seasonal adjustment issues. In 2015 the revised document was released. 6 Grudkowska, S. (2015).

6

1.2. About JDemetra+

JDemetra+ is an open source, platform independent, extensible software for seasonal adjustment (SA) and other related time series problems developed by the National Bank of Belgium. The tool enables the implementation of the ESS Guidelines on Seasonal Adjustment (2009).

JDemetra+ includes up-to-date versions of leading seasonal adjustment algorithms rewritten in Java, which is a crucial factor that enables the long-term maintenance of the tool, integration of the libraries in the IT environments of many institutions and re-use of the modules and algorithms for other purposes. JDemetra+ is not only a user-friendly graphical interface, comparable to its predecessor, Demetra+, but also a set of open Java libraries that can be used to deal with time series related issues like the SA processing of large-scale datasets, non-standard SA methods, the development of advanced research modules, temporal disaggregation, benchmarking and business cycle analysis. JDemetra+ is built around the concepts and the algorithms used in the two leading SA methods, i.e. TRAMO/SEATS and X-12-ARIMA/X-13ARIMA-SEATS. They have been re- engineered, following an object-oriented approach, which allows easier handling, extensions or modifications.

JDemetra+ version 1.5.3. is based on the following core engines:

▪ TramoSeats dlls, dated 10/2014; ▪ X12 dll (developed by the U.S. Census Bureau, based on X-12-Arima version 0.3, dated 12/2010).

One of the strategic choices for JDemetra+ is to provide common presentation/analysis tools for seasonal adjustment methods, so that the results from different methods can easily be compared. Obviously, JDemetra+ is highly influenced by the output of TRAMO/SEATS and of X- 13ARIMASEATS. Most analyses presented in JDemetra+ are available in the core engines. However, the results produced by JDemetra+ may slightly differ for a lot of reasons (different statistical/algorithmic choices). In any case the global messages from seasonal adjustment are (nearly) always similar.

Among numerous important tools implemented in JDemetra+, the following functionalities should be highlighted:

▪ RegARIMA modelling (using concepts developed in TRAMO and in X-12-ARIMA); ▪ Residuals analysis (mostly TRAMO-like); ▪ Seasonality tests (TRAMO and X-12-ARIMA-like); ▪ Spectral analysis (X-12-ARIMA definition); ▪ Sliding spans (X-12-ARIMA);

7

▪ Wiener-Kolmogorov analysis (for unobserved ARIMA components model, SEATS-like).

JDemetra+ is written using object-oriented programming (OOP) methodology. It allows developers to design software in a modular way, i.e. separate the functionality of an application into independent, interchangeable modules. Such units provide specific bunch of functionalities and can be detached from the whole concept. The object-oriented approach is especially useful in case of complex programs or when reusability matters.

Beside the statistical algorithms, JDemetra+ provides numerous peripheral services. The most important ones are the following:

▪ Dynamic access to various "time series providers": JDemetra+ provides modules to handle time series coming from different sources: Excel, databases (through JDBC), WEB services, files (TXT, TSW, USCB, XML, SDMX,...); the access is dynamic in the sense that time series are automatically refreshed, which consults the providers to download new information. The model allows asynchronous treatment. ▪ Common XML formatting: the seasonal adjustment processing can be saved in XML, which could also be used to generate WEB services around seasonal adjustment.

The graphical interface of JDemetra+ is based on the framework NetBeans 7 . Thanks to that technology external IT teams can create their own modules to enrich original software without modifying the core application. The main features that can be enriched are listed below:

Amongst the most important extension points, we have to mention:

▪ Time series providers: the users could add their own modules to download series coming from other databases; ▪ Diagnostics on seasonal adjustment; ▪ Output of SA processing.

As mentioned above, the API could be used to generate completely independent applications, but also to create, more easily, extensions to the current application.

One of the aims of JDemetra+ was to develop software which enables the comparison of the result from TRAMO/SEATS and X-12-ARIMA. For this reason, most of the analysis tools are common to both algorithms, e.g. the revision and the sliding spans analysis, even if they were originally developed in only one of them. On the other hand, all the features developed in the original programs have not always been implemented in JDemetra+; for instance, by contrast with TRAMO/SEATS, JDemetra+ does not separate the long term trend from the cycle.

7 See https://netbeans.org/.

8

1.3. About JDemetra+ User Guide

This document aims to introduce users to the main features of JDemetra+ enabling them to take advantage of this program and understand the output from consecutive steps of the analysis. The document includes step-by-step descriptions of how to perform a typical analysis and useful tips that facilitate replication of the results with user’s own data and working instructions. The JDemetra+ User Guide does not cover all available JDemetra+ functionalities. They are included in the JDemetra+ Reference Manual (2017) and the user should refer to it for necessary information.

It is assumed that the reader is familiar with concepts, such as time series, trend-cycle, seasonality, descriptive statistics, confidence level, mean square error, estimate, estimator, linear regression, stationarity, ARIMA process and so on. Readers with insufficient background to follow this document are encouraged to refer to an appropriate textbook, e.g. Chatfield (2004). Some background knowledge about seasonality in the time series can be gained from the e-learning courses on Seasonal Adjustment that are available at https://ec.europa.eu/eurostat/cros/search/custom- taxonomy/knowledge-repository-general-innovation-area/seasonal-adjustment.

JDemetra+ uses the notation "X12", "X13","Arima", "RegArima" and "TramoSeats" instead of "X- 12ARIMA", "X-13ARIMA-SEATS", "ARIMA", "RegARIMA" and "TRAMO/SEATS" respectively. This notation is also used in the JDemetra+ User Guide when the references to the user interface are made.

1.3.1. Who should use this document?

With JDemetra+, which is an extremely user-friendly software, pre-adjustment and decomposition of a time series can be performed easily by users who have absolutely no knowledge of seasonal adjustment theory. Although the output is easy to produce, its analysis, interpretation, readjustment and validation requires certain knowledge and practice. Therefore the JDemetra+ User Guide is designed for two types of users: beginners, who have only a basic knowledge of seasonality and its estimation in time series, and advanced users, who already perform seasonal adjustment and are able to interpret the outcomes, at least on a basic level.

This User Guide neither describes in detail how the seasonal adjustment methods work, nor the underlying mathematics. For those readers interested in studying seasonal adjustment methods a brief sketch of the X-13ARIMA-SEATS and TRAMO/SEATS algorithms and concepts as well as a bibliography are included in the JDemetra+ Reference Manual (2017).

1.3.2. How the document is organized

The JDemetra+ User Guide is divided into three parts.

9

Chapter 1 is designed to present general information about JDemetra+ including an installation procedure. It also gives guidance on the intended use of the document.

Chapter 2 includes general overview of the program and information concerning dealing with data. It deals with issues such as preparation of dataset and importing it to JDemetra+. In general, these preliminary steps are to be performed in each scenario.

Chapter 3 presents step-by-step scenarios described in 1.3.3 and is divided into subchapters that correspond to the consecutive scenarios. The choice of the scenario should be based on the user’s knowledge of seasonal adjustment and skill in time series analysis. This chapter refers to specific parts of the JDemetra+ Reference Manual (2017) and in this way guides the user throughout the whole document.

1.3.3. How to use this document

With JDemetra+ seasonal adjustment can be performed in several ways. Additional functionalities designed for time series analysis, not necessarily strictly related to seasonal adjustment are also provided.

The JDemetra+ User Guide offers several typical paths that can be followed to perform analyses in an efficient way. These scenarios are designed to account for different user aims and common constraints, such as the time allocated to perform the task, the size of the dataset and the user’s experience and skill in seasonal adjustment. Each scenario includes consecutive phases of analysis from preparing the source data to the investigation of the results, readjusting and regular data production. Therefore it is recommended to study each scenario from beginning to the end.

There are nine scenarios in total: four on seasonal adjustment, two on time series modelling, one on tests for seasonality one on spectral analysis and one on calendars. The four scenarios on seasonal adjustment consist of two simple scenarios for beginners and users with limited time for performing seasonal adjustment and two scenarios of more detailed seasonal adjustment for more experienced users. The simple and detailed scenarios both have one example of analysing a single time series and one example of analysing multiple time series. These scenarios can be found in section 3.

There are two time series modelling scenarios, one advanced and one basic that give examples of analysing time series characteristics. The scenario for advanced users provides a detailed analysis that includes identification and estimation of outliers8, calendar effects9, interpolation of missing

8 See 3.2.1.3 for a definition and JDemetra+ Reference Manual (2017), item 7.1.1 for more information. 9 See 3.4.3 for a definition and JDemetra+ Reference Manual (2017), item 7.2 for more information.

10

values and forecasting. The basic scenario is a limited version of the advanced analysis, focused mostly on automatic detection of outliers and calendar effects.

A scenario on seasonality tests is for all types of users and explains how to test for the presence of seasonal movements in time series. The presence of seasonality should be checked for each time series in a dataset. The tests for seasonality are integral to the seasonal adjustment procedures available in JDemetra+. However, the tests can be run independently of seasonal adjustment. The scenario on seasonality tests serves this purpose. As it is designed for analysis of a single time series, it is usually run for the detailed analysis of the most important series. For example, it can be used for checking the presence of seasonal movements to decide if a series should be seasonally adjusted or for regular monitoring of seasonality in time series.

The spectral graphs scenario is for advanced users and introduces in-depth analysis of a time series in the frequency domain.

The calendars scenario explains how to define country-specific holidays and include them into a national calendar. It also deals with the more sophisticated types of calendar and explains how to import them.

11

2. Preliminary issues: uploading and visualizing data

2.1.1. Overview of the JDemetra+

The installation procedure and system requirements are discussed in the JDemetra+ Reference Manual (2017), section 1.2.

The default view of JDemetra+ window, which is displayed after launching the program, is shown below.

Figure 2.1: JDemetra+ default window.

The majority of functionalities are available from the menu of the application, which is situated at the very top of the main window. If the user moves the cursor to an entry in the main menu and clicks on the left mouse button, a drop-down menu will appear. Clicking on an entry in the dropdown menu selects the highlighted item. Some of the functions available in the menu of the application are described in the Chapter 3.

Figure 2.2: The main menu.

12

The Browsers panel presents the list of the data sources and organizes the imported series within each data providers.

Figure 2.3: The Workspace window.

The Workspace window organizes all default and user-defined specifications (see the JDemetra+ Reference Manual (2017), item 2.2), documents and calendars defined. It is divided into three sections: Modelling, Seasonal adjustment and Utilities. The Modelling section contains a set of pre- defined specifications that enables to model the time series using two options: the TRAMO model or the RegARIMA model. The user can add new specifications by choosing New from the pop-up menu (right click on the name of the modelling option). It is also possible to create a document attached to the given specification. It can be done by choosing an option Create Document.

The Seasonal adjustment section contains a set of pre-defined specifications that enables to seasonally adjust the time series using two methods: TRAMO/SEATS or X-13ARIMA-SEATS. The user can add new specifications by choosing New from the pop-up menu (right click on the name of the seasonal adjustment option). It is also possible to create a document resulting from a given specification. It can be done by choosing an option Create Document.

Finally, the Utilities section presents all variables and calendars prepared by the user. By default, this node contains only a Default calendar (3.4.3).

A blank zone on the right is designated for displaying the actual analyses.

Figure 2.4: The Providers window.

13

Example data files are available at www.cros-portal.eu. To open the file, right-click on the appropriate provider from the Providers panel and specify the data source. The procedure for all providers follows the same logic. Examples of loading data for each provider type are presented in this chapter.

2.1.2. Source data

JDemetra+ deals with several data sources. The allowed data sources include:

▪ JDBC; ▪ ODBC; ▪ SDMX; ▪ Spreadsheets; ▪ TSW files; ▪ TXT; ▪ USCB files; ▪ XML.

All standard databases (Oracle, SQLServer, DB2, MySQL) are supported by JDemetra+ via JDBC, which is a generic interface to many relational databases. Other providers can be added by users by creating plugins.

2.1.2.1. Spreadsheets

The Spreadsheets data source corresponds to the series prepared in the Excel file. The file should have true dates in the first column (or in the first row) and titles of the series in the corresponding cell of the first row (or in the first column). The top-left cell [A1] can include a text or it can be left empty. The empty cells are interpreted by JDemetra+ as missing values and they can appear in the beginning, in the middle and in the end of time series.

An example is presented below:

14

Figure 2.5: Example of an Excel spreadsheet that can be imported to JDemetra+.

Time series are identified by their names. JDemetra+ derives some information (like data periodicity, starting and ending period) directly from the first column (or from the first row, depending on the chosen data orientation (vertical or horizontal)).

2.1.3. Import data

To import data from a given data source, click on this data source in the Providers window (2.1.1), choose Open option and specify the import details, such as a path to a data file. These details vary according to data providers. The scenario below presents how to import the data from an Excel file.

1. From the Providers window right-click on the Spreadsheets branch and choose Open option.

Figure 2.6: Data provider available by default.

2. The Open data source window contains the following options:

▪ Spreadsheet file – a path to access the Excel file.

15

▪ Data format – the data format used to read dates and values. It includes three fields: locale (country), date pattern (data format, e.g. yyyy-mm-dd), number pattern (a metaformat of numeric value, e.g. 0.## represents two digit number). ▪ Frequency – time series frequency. This can be undefined, yearly, half-yearly, four-monthly, quarterly, bi-monthly, or monthly. When the frequency is set to undefined, JDemetra+ determines the time series frequency by analysing the sequence of dates in the file. ▪ Aggregation type – the type of aggregation (over time for each time series in the dataset) for the imported time series. This can be None, Sum, Average, First, Last, Min or Max. The aggregation can be performed only if the frequency parameter is specified. For example, when frequency is set to Quarterly and aggregation type is set to Average, a monthly time series is transformed to quarterly one with values that are equal to the one third of the sum of the monthly values that belong to the corresponding calendar quarter. ▪ Clean missing – erases the missing values of the series.

Next, in the Source section click the grey "...." button (see below) to open the file.

Figure 2.7: Data source window.

3. Choose a file and click OK.

16

Figure 2.8: Choice of an Excel spreadsheet.

4. The user may specify Data format, Frequency and Aggregation type, however this step is not compulsory. When these options are specified JDemetra+ is able to convert the time series frequency. Otherwise, the functionality that enables converting the time series frequency will not be available.

Figure 2.9: Options for importing data.

5. The data are organized in a tree structure.

17

Figure 2.10: Dataset structure.

2.1.4. Displaying data

1. To display a given series right click on it and chose the Chart & grid option from the local menu. The graph is displayed in the panel on the right.

Figure 2.11: Time series graph.

2. Using the local menu that is available for the chart the user may adjust the view of the picture, save it and/or save it in a given location.

18

Figure 2.12: Local menu basic options for the time series graph.

3. Once the time series is marked by clicking on it with the left mouse button, more sophisticated options are available, in addition to the standard ones shown in Figure 2.12.

Figure 2.13: Full local menu options.

4. These additional options include the Open with option, which opens time series in a separate window according to the user choice (chart & grid or only chart). All ts views option is not available at the moment. The picture below shows the view displayed once Chart & grid option was chosen. By clicking on the marked buttons the user can switch between chart and grid view. For both views (chart and grid) the local menu is available.

19

Figure 2.14: Chart & grid view.

5. Rename option (see Figure 2.12) enables to change the time series name.

Figure 2.15: Renaming a time series.

6. The option Split into the yearly components opens an additional window that presents the analysed series data split by . This chart is useful to investigate the differences in time series values caused by the seasonal factors. The graph gives some idea about the existence and size of deterministic and stochastic seasonality in data.

20

Figure 2.16: Split into the yearly components option’s result.

7. To display more than one series on the graph, select Tools → Container → Chart from the main menu. Next, drag a drop series to the Chart window. Local menu options are available.

Figure 2.17: Chart window.

21

3. Seasonal adjustment and other time-series analysis with JDemetra+

The aim of this chapter is to introduce the main functionalities of JDemetra+. This chapter uses a step-by-step approach to the primary features of JDemetra+. It presents typical scenarios for time series analysis and shows the paths to follow with appropriate references to other parts of the JDemetra+ Reference Manual (2017) so that the user can adjust the scenario to his or her own needs.

The scenarios presented here are intended for different types of users – both advanced ones and beginners. The user is advised to select scenarios that match his or her level of experience and skills in seasonal adjustment and time series modelling. These scenarios include:

▪ Simple seasonal adjustment of a single time series – a path designed for beginners that explains how to perform seasonal adjustment using pre-defined specifications for a single time series. ▪ Simple seasonal adjustment of multiple time series – a path designed for beginners that explains how to perform seasonal adjustment using pre-defined specifications for multiple time series in a dataset. ▪ Detailed seasonal adjustment of a single time series – a path designed for advanced users that shows an in-depth analysis of seasonal adjustment results for a single time series generated by user-defined specifications. ▪ Detailed seasonal adjustment of multiple time series – a path designed for advanced users that shows an in-depth analysis of seasonal adjustment results for a multiple time series generated by user-defined specifications. ▪ Basic time series analysis – a path designed for beginners showing automatic detection of outliers and calendar effects in a time series. ▪ Advanced time series analysis – a path designed for advanced users that includes user identification and estimation of outliers and calendar effects, interpolation of missing values and forecasting. ▪ Seasonality tests – a path designed for all users describing how to test for the presence of seasonal movements in time series. ▪ Spectral graphs – a path designed for advanced users for the in-depth analysis of time series in the frequency domain. ▪ Calendars – a path designated for all users which explains how to include the countryspecific holidays into a calendar.

Before executing a scenario, install JDemetra+, run the program (see JDemetra+ Reference Manual (2017), section 1.2) and import the data following the instruction from the section 2.1.3.

22

3.1. Simple seasonal adjustment

Simple seasonal adjustment scenarios are intended for users who do not have much practical experience in seasonal adjustment. They show how to define a seasonal adjustment process, generate results swiftly, correct the specification for the most severe shortcomings (if any) and export the results. These instructions describe how to obtain results of satisfactory quality and in a reasonably short time. This is also useful for experienced users dealing with large datasets. Two paths are available here: simple seasonal adjustment of single time series and simple seasonal adjustment of multiple time series.

3.1.1. Simple seasonal adjustment of single time series

This scenario guides the user through all the steps involved in the process of seasonally adjustment a single time series. Links to appropriate parts of the JDemetra+ Reference Manual (2017) for detailed explanations on actions to be performed are enclosed when necessary.

1. Go to the main menu and follow the path: Statistical methods → Seasonal adjustment → Single analysis. Select a seasonal adjustment method (TramoSeats (i.e. the TRAMO/SEATS method will be used) or X13 (i.e. the X13ARIMA-SEATS will be used).

Figure 3.1: Launching a seasonal adjustment for a single time series.

2. An empty panel will be opened. Figure 3.2 presents the view, which is displayed when the X13ARIMA-SEATS method is chosen.

23

Figure 3.2: Single analysis window.

3. Select a data provider and unfold an already imported dataset. Drag and drop one time series from the Providers window to the Drop data here box as shown below. The window contains two panels. The one on the left presents the structure of the output in a form of an output tree. The other one is empty. Once seasonal adjustment has been performed, this panel will show detailed results for any item chosen by the user from the output tree.

Figure 3.3: Staring a seasonal adjustment process.

4. When the user drops series into the document window (X13Doc in the example presented in this scenario) JDemetra+ starts the seasonal adjustment process automatically. By default, a summary of results is displayed. It is accompanied with two graphs: the original data, seasonally-adjusted series and the trend-cycle on the left and SI ratio values on the right. The diagnostics and graphs are discussed in the JDemetra+ Reference Manual (2017), Chapter 4 and

24

Chapter 5 (see 5.2.2 for X-13ARIMA-SEATS, 5.2.1 for TRAMO/SEATS). The Main results panel provides

a first impression about the quality of the adjustment. Study the diagnostics section using the vertical scrollbar.

Figure 3.4: Simple seasonal adjustment, single time series: main results panel.

5. The results are in green, yellow or red text, depending on the result of statistical test used. Those in green denote that the problematic characteristic has not been detected (e.g. lack of normality of residuals, the autocorrelation in residuals). The outcome in yellow means that the test outcome is uncertain. The outcomes in red denote cases where an issue should be addressed. The user is expected to investigate the problematic test statistics and try to improve the model, so as no uncertain or rejected tests’ results are present.

25

Figure 3.5: Diagnostic results – simple seasonal adjustment of single time series.

6. To explore the results, expand the tree in the left panel and click on the desired node. Here Outof-sample test was chosen (see the JDemetra+ Reference Manual (2017), 4.2.3).

Figure 3.6: Exploring the results.

7. The default specification used for a seasonal adjustment can be modified by clicking on the Specifications button.

26

Figure 3.7: Changing a default specification.

8. The Specifications panel presents settings that have been used to generate the current output.

Figure 3.8: Specification panel.

9. To change a given setting, click on it and choose an option from the list and/or enter a value. In the picture below the series span was shortened by first 12 observations. Inputs in green indicate that the entered values are acceptable (appropriate format, data within the allowed range and so on). To check the effect of the changes click on the Apply button in the bottom part of the window.

27

Figure 3.9: Modifying settings.

10. Be aware that the changes introduced may lead to changes in the output for other parts of the results. The example below illustrates that omitting the first 12 observations results in an automatic detection of the trading effect and the Easter effect, which were not present in the previous model.

Figure 3.10: The effect of applying modified settings.

11. To copy the estimated series (seasonally adjusted, trend, seasonal and irregular) to another file go to the Table item in the Main results section of the output tree. Then click on the upper-left cell in the table.

28

Figure 3.11: Marking a decomposition results.

12. Copy the series by clicking the Copy item from the context menu or use the standard Ctrl+C keys. Other options from this menu are explained in the appropriate items of JDemetra+ Reference Manual (2017), item 4.2.3.

Figure 3.12: Copying a dataset.

13. Paste the series to the destination file (e.g. TXT, Excel).

Figure 3.13: Easy exporting data to Excel file.

29

14. To save the document created in JDemetra+ (named X13Doc-1 in our example) select Save Workspace As… item from the File menu.

Figure 3.14: Saving a workspace.

15. Enter the location, workspace name and click Save.

Figure 3.15: Choosing a destination folder.

16. The document is visible in the Workspace window under the appropriate section (x13 in the case presented in the picture). The document can be opened, deleted or renamed from the context menu.

30

Figure 3.16: The content of the context menu for a single document.

17. The user can also add comments to the document. To display the comments and modify them, click on Edit comments from the context menu (see Figure 3.16).

Figure 3.17: An Edit comments window.

18. So far, the time series name is labelled as frozen. It means that the user is being presented the results already saved in the workspace. The option Refresh data is active when the given workspace is opened again. This option can be activated either from a local menu or from the main menu. Once it is activated, JDemetra+ refers to the data source defined in the workspace

31

and uses the current version of data to perform adjustment with settings saved in the document.

Figure 3.18: Refreshing the data.

3.1.2. Simple seasonal adjustment of multiple time series

This scenario is intended for a seasonal adjustment of a dataset of multiple time series. It is especially useful when hundreds of series need to be processed and the quality of their adjustment assessed. This scenario can be used in a regular production process. As it does not focus on individual series, it is not recommended for an adjustment of key indicators that requires a detailed analysis of results and refining of the seasonal adjustment settings. The scenario shows the steps of the data generating process for multiple series, with references to appropriate parts of the JDemetra+ Reference Manual (2017) for more detailed explanations. Although this case study is intended for the datasets, it can be also performed for a single time series, provided that the analysis is done in a multi-document.

1. Go to the main menu and follow the path: Statistical methods → Seasonal adjustment → Multi Processing → New to open a multi-document.

32

Figure 3.19: Launching a seasonal adjustment for a dataset.

2. JDemetra+ opens an empty window (default name: SAProcessing-1). By default, one of the predefined specifications (see the JDemetra+ Reference Manual (2017), section 5.1 will be used for a seasonal adjustment of a dataset. To change the specification used for an adjustment in the current document, click on the button marked in the picture below. This will provide you with the alternative methods of adjustment. To change the settings for a pre-defined specification used by default for an adjustment, see JDemetra+ Reference Manual (2017), section 3.4.7).

Figure 3.20: Default window for seasonal adjustment process for a dataset.

3. The list available from the SAProcessing window includes the pre-defined specifications and the user-defined specifications (if any). For a description of the user-defined specifications see 3.2.1.1). Click on the specification that will be used for a seasonal adjustment (in the example below RSA4 is selected).

33

Figure 3.21: Choice of the specification.

4. Drag and drop series from the Providers window to the SAProcessing window. You can drag and drop individual series or an entire dataset (i.e. a set of series that have been imported together, e.g. series from the same Excel file). It is possible to drag and drop the same series several . It allows the user to apply different specifications to the same time series in order to compare the results. The series visible in the SAProcessing window are not seasonally adjusted yet (Status – "Unprocessed"). Adjustment will be performed using RSA4 specification. For a newly created SAProcessing window the Estimation column is always set to Concurrent, which means that previous results for these time series will not be taken into account once this seasonal adjustment is launched (as they do not exist). However, a seasonal adjustment processing window may be saved and re-launched in the next session of JDemetra+. Then the user can decide if and how the previous results are used in the current session. At this stage the Priority, Quality and Warnings columns are empty as seasonal adjustment has not yet been performed.

The revisions issue is discussed in depth in 3.2.2.2.

34

Figure 3.22: Adding the series to the multi document.

5. Once the user clicks on the start button (the button with a green arrow) the time series are processed, the statuses are updated and some information about the quality of the adjustments and possible problems are displayed in the Warnings column as exclamation marks.

Figure 3.23: The Start button.

6. Generally, the warnings are put forward for short series, non-decomposable models (SEATS) or when the differenced series do not show seasonal peaks. Information on the warnings is displayed when the cursor hovers over an exclamation mark.

Figure 3.24: The results of a seasonal adjustment process.

35

7. When the user clicks on an individual time series in the SAProcessing window, detailed results are displayed in the panel below the list of the series. By default, a summary of results is displayed, accompanied by two graphs: original data, seasonally-adjusted series and the trendcycle on the left and SI ratio values on the right. These diagnostics and graphs are discussed in JDemetra+ Reference Manual (2017), Chapter 4 and Chapter 5 (see 5.2.2 for X- 13ARIMA-SEATS, 5.2.1 for TRAMO/SEATS).

Figure 3.25: The inspection of the seasonal adjustment results for a chosen time series.

8. The Main results panel provides information on the quality of the adjustment. Study the diagnostic section using the vertical scrollbar. The results are marked in green, yellow or red, depending on the result of a statistical test used. Those in green denote that the problematic characteristic has not been detected (e.g. lack of normality of residuals, the autocorrelation in residuals). The outcome in yellow means that the test outcome is uncertain. The outcomes in red denote cases where an issue should be addressed. Hence, test statistics will indicate the need to improve the model. Ideally, the model should be improved so that no test statistics indicate uncertainties is the results.

36

Figure 3.26: The diagnostics results – simple seasonal adjustment of a multiple time series.

9. To explore the results, expand the tree on the left and click on the desired node. Here out- ofsample test was chosen (see the JDemetra+ Reference Manual (2017), 4.2.3).

Figure 3.27: Out-of-sample test results.

10. The specifications used for a seasonal adjustment of an individual series can be changed by clicking on the Specifications button as described in the section 3.1.1.

11. To export the output for a whole dataset, select the Output item from the SAProcessing menu.

37

Figure 3.28: The SAProcessing menu.

12. Expand the "+" menu and choose an appropriate data format (here Excel has been chosen). It is possible to save the results in TXT, XLS, CSV, and CSV matrix formats. Note that the available content of the output depends on the output type (see the JDemetra+ Reference Manual (2017), 7.7 for more details).

Figure 3.29: Exporting data to an Excel file.

13. Specify export details and click OK. For more output options see 3.2.2.1.

38

Figure 3.30: Defining an export details.

14. To save the workspace that includes the results in the processing window (named SAProcessing-1 in the example) select Save Workspace As… item from the File menu.

Figure 3.31: Saving the workspace.

15. Enter the location and the workspace name and click Save.

39

Figure 3.32: Saving details.

16. The document is visible in the Workspace window under the multi-documents branch.

Figure 3.33: The content of the context menu for a multi-document.

17. The document can be opened, deleted or renamed from the context menu. The user can also add comments to the document (see 3.1.1). When JDemetra+ is launched again the saved workspace can be opened and the multi-document can be run again.

40

Figure 3.34: Reopening the multi-document.

18. The seasonal adjustment can be refreshed by clicking on the green arrow button or by choosing the refresh option from SAProcessing menu (note that the name of this main menu item corresponds to the name of the processing window). Refreshing policies are presented in 3.2.2.2.

Figure 3.35: Refreshing option.

3.2. Detailed seasonal adjustment

Detailed seasonal adjustment scenarios present the in-depth analysis of seasonal adjustment results for time series generated with the user-defined specifications. They are intended for the advanced users who already have some practical experience of seasonal adjustment. They focus on how to correct the deficiencies of the specification and improve the modelling. This section is divided into two parts: Detailed seasonal adjustment of single time series and Detailed seasonal adjustment of multiple time series.

41

3.2.1. Detailed seasonal adjustment of single time series

This part guides the user through functions that can be used in the process of seasonal adjustment of a single time series. It explains how to use available options to enhance the automatically selected seasonal adjustment model. This part is divided into several case studies. Each of them address a certain issue and suggests how to deal with it.

As prerequisite, the 3.1.1 scenario should be studied. The majority of the case studies in this section concern working with modelling or seasonal adjustment specifications. These issues are explained in 3.2.1.1.

Links to the appropriate parts of the JDemetra+ Reference Manual (2017) for detailed explanations on actions to be performed are provided when necessary.

3.2.1.1. Defining and modifying a specification

In general, the user can influence on the parameters of the seasonal adjustment process by creating a specification with given settings or by changing some settings in the specification currently in use.

1. To create a new specification go to the Workspace window choose a node for which you wish to add a specification (Modelling or Seasonal adjustment) and choose a method (tramo or regarima for Modelling, tramoseats or x13 for Seasonal adjustment). Click on the left mouse button and choose a New option. The user can also import the specification from the external file with the Import from option.

Figure 3.36: Adding a new specification.

2. Next, unfold the node (the tramoseats node in the case presented here) and right click on the newly created specification (TramoSeatsSpec-1 in the case presented below) to open the local menu. The local menu offers the following options:

42

▪ Open – displays the specification’s settings ▪ Export to – enables the user to save the specification in a config file. ▪ Delete – removes the specification from the workspace. ▪ Rename – enables the user to change the name of the user-defined specification. ▪ Edit comments – a functionality for monitoring a seasonal adjustment process is implemented. The user can add and modify short notes concerning a given time series. These notes are visible in the Comments column in the Processing window. The notes are displayed when the user hovers the mouse on the given cell. ▪ Create document – adds a new document to the relevant place in the Seasonal adjustment → documents section and assigns the specification selected by the user to it. ▪ Clone – creates the copy of the specification and adds it to the list.

Chose Open from the menu.

Figure 3.37: Opening a new specification.

3. The Specification window is divided into several section. The actual content depends on the choice made by the user in the step 1 of this scenario. To introduce changes unfold the sections, modify the current settings (chose from the list or insert the value by hand) and confirm the changes with the OK button.

43

Figure 3.38: Modifying a new specification.

4. User-defined specifications are usually used for seasonal adjustment of many time series (Statistical methods → Seasonal adjustment → Multi Processing → New). The user intervention can be also made after a modelling/seasonal adjustment process. In such case, to introduce changes click on the Specification button. JDemetra+ opens the Specifications panel on the right. Unfold the sections, modify the current settings (chose from the list or insert the value by hand) and confirm the changes with the Apply button. JDemetra+ automatically apply the new settings and displays the outcome resulting from the modified specification.

44

Figure 3.39: Modifying a specification which is currently in use.

3.2.1.2. Non-seasonal time series

The ESS Guidelines on Seasonal Adjustment (2015) recommend to apply a seasonal adjustment only to those time series for which the seasonal and/or calendar effects can be properly explained, identified and estimated. Therefore, seasonal adjustment of non-seasonal time series is an inappropriate treatment. This case study explains how to recognize a non-seasonal time series using the tools and functionalities implemented in JDemetra+.

1. The picture below shows the result from seasonal adjustment performed for a stock market turnover in Greece using the RSA4c specification. The test diagnostics do not indicate any problems in the modelling phase (residual seasonality statistics and out-of-sample tests are displayed in green). The seasonality seems to be removed from the time series, but the overall assessment is uncertain, due to the failure of m-statistics and the visual spectral analysis.

45

Figure 3.40: The diagnostic results for stock market turnover in Greece.

2. The inspection of a graph hints the source of the problem. The original time series does not manifest any seasonal movements (left panel). It should be noted that when X- 13ARIMASEATS method is used for seasonal adjustment, the seasonal component is estimated regardless the properties of the original time series (right panel). It means that the seasonal component is estimated even if there are no signs of a presence of the seasonal fluctuations in the time series. In the picture below the seasonal component (blue line) is moving rather than stable and the averages for the specific (red lines) are not at the same level, suggesting some intrayear differences between . Nevertheless, the SI ratios (dots) are rather far from seasonal component, indicating that the irregular movements dominate over the seasonal ones.

Figure 3.41: Original and seasonally adjusted time series and the trend-cycle component (left) and SI ratios (right).

3. The seasonality tests performed for the original time series9 are ambiguous. Some suggest that seasonality is not present (the outcomes of three tests: the auto-correlation at seasonal lags, the

9 When the series are non-stationary a differentiation is performed before seasonality tests.

46

spectral peaks test and the seasonal dummies test indicate no seasonality in the original time series). These tests are available in the Diagnostic section of the output tree. The descriptions of the tests are given in 3.4.1.The seasonality tests can be also executed independently from the seasonal adjustment process, as it is shown in 3.4.1.

Figure 3.42: Seasonality test for the original (transformed) series.

4. Another sign that indicates that the presence of seasonality issue should be addressed is the non-seasonal ARIMA model chosen by the automatic model identification procedure. The details of the RegARIMA model are available in the Pre-processing node.

Figure 3.43: Estimation results for the RegARIMA model.

5. For X-13ARIMA-SEATS the most meaningful tool to assess the presence of seasonal movement in the time series is a combined seasonality test. For the series presented in this case study the

47

result of the combined seasonality test confirms that the movements observed in the time series are not stable and regular enough to be recognized as the seasonal ones.

Figure 3.44: Combined seasonality test result.

6. Regardless of the presence and/or significance of seasonal movements in the original time series the seasonal component is always estimated by X-13ARIMA-SEATS, as shown in the picture below (from the panel on the left choose Main results → Table). Therefore the X- 13ARIMASEATS users should always check the outcome of the combined seasonality test.

Figure 3.45: Decomposition’s results.

7. In general, in case of a non-seasonal time series the TRAMO/SEATS method produces more coherent results than X-13ARIMA-SEATS. When no seasonal movements are detected the nonseasonal ARIMA model is used and the seasonal component is not estimated.

48

Figure 3.46: Decomposition result for a non-seasonal time series.

8. Consequently, the SI ratios (dots) estimated by TRAMO/SEATS are equal to the irregular component and for each the seasonal component is equal to the mean (red, horizontal line), which is zero.

Figure 3.47: SI ratios for a non-seasonal time series.

3.2.1.3. User-defined outliers

Outliers10 are abnormal values of a time series. In general, they cannot be properly explained by the ARIMA model and its underlying normality assumption. They tend to be associated with the irregular special events that produce a distortion on the series. The presence of such values disturbs the modelling of time series with methods like X-13ARIMA-SEATS and TRAMO/SEATS because of the linear procedures (e.g. moving averages and regression analysis) implemented in them. The presence of outliers has an adverse effect on the quality of seasonal adjustment because outliers can lead to the model misspecification, biased parameter estimation, poor forecasts and inappropriate decomposition of the series. Therefore, it is vital to identify and include them in the modelling step of seasonal adjustment. The aim is to remove the effect of outliers from a time series before its decomposition into the components. Both X-13ARIMA-SEATS and TRAMO/SEATS include automatic procedure for outliers’ treatment (detection and correction). However, a priori information about an that may have caused abnormal observations (the date of its occurrence

10 Definition of outliers is based on Kaiser, R. and Maravall, A. (2003).

49

and type of an effect) can be included in the model by the user. This case study explains how to do it.

In the automatic outlier detection and correction procedures, three outlier types are considered by default:

▪ additive outlier (AO) – an abnormal value in an isolated point of the series; ▪ transitory change (TC) – a series of outliers with a temporarily decreasing effect on the level of the series; ▪ level shift (LS) – the series of innovation outliers with a constant long-term effect on the level of the series, where for an innovation outlier is meant an anomalous value in the innovation series.

Seasonal outliers, which are defined as an abrupt increase or decrease of the seasonal component for a specific month or quarter and are of permanent nature can be automatically detected once the user chose the appropriate option. The relevant instructions are given in this case study.

The user may introduce to the model also a ramp effect, which is described as a smooth, linear transition between two time points unlike the abrupt change associated with level shifts. This case study explains how to add the ramp effects into a specification.

The formulas that describe outliers are given in the JDemetra+ Reference Manual (2017), item 7.1.

1. The picture below presents the outflow from the number of registered unemployed persons in Poland. It is clear that in the beginning of 1999 the sudden, permanent shift in the trend level took place as a result of a poor condition of the economy. In the end of 2008 a single peak can be observed, which can be interpreted as a reaction of the entrepreneurs on the beginning of the economic crisis.

Figure 3.48: Time series graph.

50

2. To include these events in the model, first create and open a new specification as shown in 3.2.1.1.

3. In the Regression section choose a Pre-defined outliers item.

Figure 3.49: Activating a Pre-specified outliers option.

4. In a newly opened window choose the localization (here: 01.1999) and an outlier’s type. Note that more than one outlier can be assigned to the specific period.

Figure 3.50: An input window for entering a pre-specified outlier.

51

5. Enter the relevant information for the next abnormal observation. Once all pre-defined outliers are entered, click Done.

Figure 3.51: Confirming the settings for the pre-specified outliers.

6. Pre-specified outliers are visible in the Specification window. The localization and type of userdefined outliers are not to be verified in the seasonal adjustment process. Click OK to confirm your choice.

Figure 3.52: Specification that includes the pre-specified outliers.

7. Use the newly created specification to perform a seasonal adjustment using a Multi Processing option (see 3.1.2).

52

Figure 3.53: Choosing a specification.

8. Go to the pre-processing node and analyse the output. The outliers are divided into two parts: pre-specified outliers introduced by the user and outliers identified by the software.

Figure 3.54: Estimation results for the pre-specified outliers.

9. If some changes are needed (e.g. in the analysed example the pre-specified outlier AO (12- 2008) is statistically insignificant) click on the Specification button and modify the settings in the Prespecified outliers section.

53

Figure 3.55: Modifying a specification.

10. Automatic identification of the seasonal outliers is performed once the user marks the seasonal outlier item in the Specification window and confirms this choice with the Apply button. Detected seasonal outliers (if any) are displayed in the pre-processing panel.

Figure 3.56: Launching an automatic identification of seasonal outliers.

11. Alternatively, the user may include identification and estimation of the seasonal outliers in the user-defined specification (see 3.2.1.1) by marking the Seasonal option in the Outliers section.

12. To include a Ramp effect go to the Regression part of the specification and click a Ramp effects item.

54

Figure 3.57: Activating a ramp option.

13. In a newly opened window use “+” button to add a ramp effect. Modify the default start and end date of the effect. Add more ramps if necessary and click Done.

Figure 3.58: Introducing the parameters for a ramp regression variable.

14. Ramps are visible in the Regression section. Click Apply to confirm your input and analyse the output.

55

Figure 3.59: Estimation results for a ramp regression variable.

3.2.1.4. User-defined calendar variables

Although the flexible tool for defining of the calendars is implemented in JDemetra+ (section 3.4.3), in some cases it might be necessary to use the user-defined variables due to very special constellations and/or expected heterogeneous period-specific calendar sensitivity.

For example, in Germany the expected influence of one additional working day on output differs between months. Around Christmas the production activity is lower since many employees are on leave during these days. Hence, many companies are closed for holidays at the end of the year. Therefore, the influence of one additional working day is expected to be lower in December on average than in the remaining months from January until November. Besides, regional public holidays in Germany differ across federal states. To take this into account a weighting approach is necessary. Furthermore, it is not the number of working days but the deviation of this number of working days from its long-term average in a specific month, which is used to model the calendar effects. Since the functionality for centring the variables is not available in JDemetra+, the user need to prepare the centred regressors by himself and use them in the model.

1. To be able to use a user-defined variables as the calendar regressors, first a new dataset that contains variables has to be created in the Workspace window. To do it, right click on the Variables item and chose the option New.

56

Figure 3.60: Creating the dataset for the user-defined variables.

2. The new dataset is available in the Variables node. Right click on it to display the options from the local menu. The dataset can be renamed and removed. Once the variables are added to the dataset, the user can export the dataset and refresh the variables with new/revised data (if such data are available). To add the variables to the dataset chose an Open option. JDemetra+ opens an empty Vars-1 window.

Figure 3.61: Opening the Vars-1 window.

3. Now, the data which are to be used as the regressor variable(s), have to be imported into the Workspace window. The regressors can be imported like all other time series through the different channels (see section 2.1.3). In this case the Spreadsheets data source is used for the data import from an excel file. Drag and drop variables from the Workspace window to the Vars-1 window.

57

Figure 3.62: Importing the variables.

4. After dropping the regressor series into the variable dataset created in the step 1, the new variables (in this case x_1 - working days from January to November and x_2 - working days in December) occur in the variable window. Now the new regressors can be renamed with the option from the local menu.

Figure 3.63: Investigating the variables dataset.

5. These variables can be used in the modelling (3.3) or seasonal adjustment (3.1, 3.2) procedures. The user can use these variables in the newly created specification. In this example a new specification file X13Spec-1 is created (see 3.2.1.1) and used for this purpose.

58

Figure 3.64: Opening a user-defined specification.

6. Once it is opened by either a double-clicking or a right mouse click (select Open), first go to the Regression section, unfold the Calendar section and then open the tradingDays section. Then, change the option setting from Default to UserDefined.

59

Figure 3.65: Settings to include user defined calendar variables into a specification.

7. The specific calendar regressors can now be selected via the option userVariables. By clicking Unused in the cell next to this option a new dialog window is opened.

60

Figure 3.66: Opening a dialog box to input the user-defined calendar variables.

8. To define the regressor(s) as the calendar variables select them in the panel on the left and click the arrow to move them to the panel on the right. All variables that appear in the panel on the right will be used in the modelling of the calendar effects. Click Done to confirm your choice.

Figure 3.67: Choosing the calendar variables.

9. In this case study two variables were chosen to be used in the modelling of the calendar effects. They can be seen next to the option userVariables. In the last step one can decide the algorithm will use the user defined variables. This can be set by choosing one of the test options (see the

61

JDemetra+ Reference Manual (2017), section 4.1.1.3 for a more detailed description on these significance tests).

Figure 3.68: Options for testing procedure to include calendar variables in the model.

10. The figure below presents the output from the calendar adjustment with the user defined variables. This output is very similar to the one from the calendar adjustment using the pre- specified calendar variables (see the JDemetra+ Reference Manual (2017), section 4.2.2. Although is insignificant (p-value above 0.05) the calendar variables defined by the user are jointly significant (p-value for the joint F-test is below 0.05).

Figure 3.69: An extract from the seasonal adjustment output presenting the results for the calendar variables.

11. The calendar variables can be also applied to modify a specification currently in use. For example, once the seasonal adjustment is done, the user-defined calendar variables can be introduced to the specification to study their impact on the results and choose the best model settings (see 3.1.1 for more details).

62

Figure 3.70: Modifying a current specification to include user-defined calendar variables.

3.2.1.5. Series span and model span

By default, JDemetra+ performs an analysis on a whole span available for a time series. However, in some cases there is a need to limit an analysis to a subset (span) of a time series.

According to the Guidelines on seasonal adjustment (2015), “in the context of seasonal adjustment it is possible to assume heuristically that long time series are those exceeding twenty of length. Performing seasonal adjustment of long time series can be difficult. Over such a long period the underlying data generating process may change, determining changes also in the components and in the components structure. In this case, to perform the adjustment over the whole series may produce sub-optimal results, mainly in the most recent and the initial parts of the series. Therefore it is reasonable to limit long time series to the most recent observations”.

Another case in which a limitation of a time series can be considered is a presence of a peak in the spectrum from the seasonally adjusted series or irregulars11. Also a change to the method or timing of data collection might be a reason for a shortening of a time series.

JDemetra+ offers two useful options to deal with the issue of the length of time series: model span and series span. Model span determines the subset of a time series that is used for the seasonal

11 Guide to seasonal adjustment with X-12-ARIMA (2007).

63

adjustment/modelling process. When the user limit the original time series to a given span, only this span will be used in the computations.

On the other hand, Series span determines the time series span used for the estimation of the preprocessing mode. This option can be utilized when, for example the user does not want data early in the series to affect the forecasts, or, alternatively, data late in the series to affect regression estimates used for the pre-adjustment before seasonal adjustment. The span determined by the Model span option is used for modelling and decomposition of a span resulting from the settings chosen for the Series span.

Figure 3.71: The Model span options.

The description of an available Series span and Model span types are given in the JDemetra+ Reference Manual (2017), sections 5.1.1.1 and 4.1.1.1.

3.2.1.6. Transformation choice

Logging is an is an optional transformation of the original data that is applied to achieve a stationary autocovariance function. The decision concerning logging (or not) the time series has a great impact on seasonal adjustment outcomes12. JDemetra+ offers two options: logging (which means that the multiplicative decomposition is used) or no transformation (the additive decomposition is used). The selection of the transformation type can be done automatically, on a basis of the outcome of a log-level test.

12 ESS Guidelines on Seasonal Adjustment (2015).

64

The test used by TRAMO/SEATS is based on the maximum likelihood estimation of the parameter λ in the Box-Cox transformations (which is a power transformations such that the transformed values of time series y are a monotonic function of the observations, i.e.:

(yα

yiα = { i λ− 1) , λ ≠ 0

log yiα, λ = 0

The automatic procedure first fits two Airline models (i.e. ARIMA (0,1,1)(0,1,1)) to the time series: one in logs (λ = 0), other without logs (λ = 1). The test compares the sum of squares of the model without logs with the sum of squares multiplied by the square of the geometric mean from the model in logs. Logs are taken in case the last function is the maximum13. The parameter fct controls the bias in the log/level pre-test (the function is active when Function is set to Auto); fct > 1 favours levels, fct < 1 favours logs. The same test is used for a modelling with the TRAMO model (see 3.3.2).

Figure 3.72: The Transformation options for the TRAMO/SEATS method.

13 Gómez, V., and Maravall, A. (1998).

65

The test used by X-13ARIMA-SEATS is based on the AICC information criteria14. To choose the transformation type X-13ARIMA-SEATS fits the RegARIMA model to the untransformed and transformed series and chooses the log transformation except when15:

AICClog − AICCno log < ΔAICC , where:

AICCno log is the value of AICC from fitting the RegARIMA model to the untransformed series;

AICClog is the value of AICC from fitting the RegARIMA model to the transform series; ΔAICC is the threshold value; ΔAICC> 0 favours levels, ΔAICC < 0 favours logs.

The RegARIMA model used in the test is the one specified in the ARIMA part of the specification. If no intervention is made the (0,1,1)(0,1,1) model is used. The same test is used for a modelling with the RegARIMA model (see 3.3.2).

Figure 3.73: The Transformation options for the X-13ARIMA-SEATS method.

According to the ESS Guidelines on Seasonal Adjustment (2015), the automatic procedures should be applied for the transformation choice, however in case of the most problematic series the manual selection is recommended. The manual selection of the transformation is usually made in the specifications used for a regular data production.

The options available for functionalities presented in this case study are described in the JDemetra+

14 Formula and further information available in Grudkowska, S. (2015). 15 Description from Guide to seasonal adjustment with X-12-ARIMA (2007).

66

Reference Manual (2017), item 4.1.1.2 for TRAMO/SEATS and TRAMO, and item 4.1.2.2 for X13ARIMA-SEATS and RegARIMA.

1. To determine the transformation choice first create and open a new specification as shown in 3.2.1.1.

2. For tramo and tramoseats specifications from the Transformation section choose the function option and input the fct parameter’s value. Click OK to confirm your choice.

Figure 3.74: Transformation’s option for the tramoseats specification.

3. For the regarima and x13 specifications from the Transformation section choose the function option and Aic difference parameter’s value. Click OK to confirm your choice.

67

Figure 3.75: Transformation’s option for X13 specification.

It is also possible to change the transformation’s options in the currently used specification (see 3.2.1.1, step 4).

3.2.1.7. Customised seasonal filters

Seasonal filter is a weighted average of a moving span of fixed length of a time series that can be used to remove a fixed seasonal pattern. X-13ARIMA-SEATS uses several of these filters, according to the needs of the different stages of the program. As only X-13ARIMA-SEATS allows the user for a manual selection of a seasonal filter, this case study can be applied only to the X-13ARIMASEATS specifications.

In general, an automatic seasonal adjustment procedure with the default options selects the most appropriate moving average. However there are occasions when the user will need to specify a different seasonal moving average to that identified by the program. For example, if the SI values do not closely follow the seasonal component, it may be appropriate to use a shorter moving average. Also a presence of the sudden breaks in the seasonal pattern – e.g. due to changes in the methodology – can affect adversely the automatic selection of the most appropriate seasonal filter. In such cases the usage of short seasonal filters in the selected months or quarters can be considered. In general, short seasonal filter (3 × 1) allows seasonality to change very rapidly over time. However, very short seasonal filter should not normally be used, as it will usually lead to large revisions as new data becomes available. If short filter is to be used it will usually be in one month/quarter, and because there is a known reason for wanting to track a fast changing seasonality.

In the standard situation one seasonal filter is applied to all individual months/quarters. The estimation of seasonal movements is therefore based on the sample windows of equal length for each individual month/quarter (i.e. for each month/quarter the seasonal filter length or the number of years representing the major part of the seasonal filter weights is identical). This approach relies on the assumption that the number of periods, in which the conditions causing seasonal behaviour are sufficiently homogenous, is the same in all months/quarters. However, this assumption does not always hold. Seasonal causes may change in one month, while staying the same in others16. For instance, seasonal heteroskedasticity might require different filter lengths in different months or quarters.

Another interesting example is industrial production in Germany. It can be is influenced by school holidays, since many employees have school-age children, and therefore interrupt their work during the school holidays. Thus, also businesses temporarily suspend or lower production. Since school holidays do not occur at the same time throughout Germany and their timing varies from

16 ESS Guidelines on Seasonal Adjustment (2015).

68

year to year in the individual federal states, the effect is not completely captured by seasonal adjustment. And since school holidays are treated as usual working days, these effects are not captured by calendar adjustment either. The majority of school holidays in Germany can take place either in July or in August. This yields higher variances in the irregular component for these months compared to the rest of the year. Therefore, a longer seasonal filter is to be used in these months to account for this.

Another example might be given by German retail trade. Due to changes in the consumer behaviour around Christmas – possibly more gifts of money – the seasonal peak in December becomes steadily less pronounced. To account for this moving seasonality, shorter seasonal filters in December than during the rest of the year need to be applied.

JDemetra+ offers the options to assign a different seasonal filter length to each period (month or quarter). The program offers these options in the single spec mode as well as in the multispec mode, albeit they are available only in the Specifications window, after a document is created.

1. Go to the X11-part of the Specification window (see 3.1.1, step 8). By default a single pre-defined filter length (Msr) is used for all months or quarters.

Figure 3.76: Default seasonal filter options.

2. To change the seasonal filter for all months/quarters, use a drop down menu, which is displayed after clicking on the cell next to the Seasonal filter option.

69

Figure 3.77: Choosing a seasonal filter for all periods.

3. To change the filter length for a single month, click on the empty cell next to Details on seasonal filters. A new window appears in which the filter lengths for each month is given. Click on the cell next to the month in which the filter length is to be changed. Again a drop down menu appears where the filter length can be selected. Once the changes are introduced close this window.

Figure 3.78: Seasonal filters’ choice.

4. To apply new settings click the Apply button.

70

Figure 3.79: Launching a seasonal adjustment process with modified set of seasonal filters.

3.2.1.8. Direct versus indirect approach

Economic time series are often computed and reported according to a certain classification or a breakdown. For example, in National Accounts total consumption expenditures are a sum of individual consumption expenditures and General Government & NPISHs consumption expenditures. Therefore, the seasonally adjusted aggregates can be computed either by aggregating the seasonally adjusted components (indirect adjustment) or adjusting the aggregate and the components independently (direct adjustment). The point is that these two strategies result in different seasonally adjusted aggregates. As neither theoretical nor empirical evidence uniformly favours one approach over the other, the choice of the seasonal adjustment strategy concerning aggregated series depends on the user17. Guidance in this field is given in the ESS Guidelines on Seasonal Adjustment (2015).

1. JDemetra+ offers a Direct–Indirect Seasonal Adjustment functionality that facilitates the comparison of the results from these two strategies, which is launched from the main menu.

17 Description based on the ESS Guidelines on Seasonal Adjustment (2015).

71

Figure 3.80: The Direct-Indirect Seasonal Adjustment tool.

2. To start the analysis drag and drop time series to the top-left panel. The panel on the right presents the sum of selected series.

Figure 3.81: Choosing series for an analysis.

3. By going to the main menu and clicking on Window → Properties, one can specify benchmarking options for direct-indirect comparison. Be aware that the properties window displays the properties of an active item. Therefore, first click on the time series graph in the picture below and then activate the Properties window.

72

Figure 3.82: The properties of the Direct – Indirect seasonal adjustment functionality.

4. By default, the pre-defined TRAMO/SEATS specification is used [RSAfull] (see the JDemetra+ Reference Manual (2017), section 5.1) for seasonal adjustment of a dataset. To change it, click on the button marked in the picture below. This will provide you with the alternative specifications. Here the user defined specification named My spec is chosen.

Figure 3.83: Choosing a specification for the analysis.

5. Next, run the process by clicking the button with a green arrow.

73

Figure 3.84: Running a process.

6. The bottom panel presents the detailed results. Seasonality test node presents the outcome of the seasonality tests (see 3.4.1) performed for the aggregated series adjusted directly (Direct sa) and indirectly (Indirect sa). The reason for presenting here these tests is that the presence of residual seasonality and calendar effects should be monitored, especially in the indirectly adjusted series 18 . It might happen that the seasonality is successfully removed from the components but it is still present in the aggregated series.

Figure 3.85: Seasonality tests’ results for a direct seasonal adjustment.

7. Differences node presents the properties of differences between direct and indirect seasonal adjustment results. The Statistics section shows basic statistics (average, standard deviation, minimum and maximum) for the relative differences (%) between the direct and the indirect SA series. Chart contains the graph of the differences, while Table includes the actual values.

18 ESS Guidelines on Seasonal Adjustment (2015).

74

The Periodogram section presents graphs for two spectral estimators – periodogram and auto- regressive spectrum. For their description refer to the 3.4.2.

Figure 3.86: Graph presenting the differences between direct and indirect seasonal adjustment’s results.

8. The Details node include the basic statistics for the relative differences between benchmarked and original series and the actual time series adjusted directly (Sa series) and indirectly (Benchmarked Sa series).

Figure 3.87: Details of the differences between direct and indirect seasonal adjustment results.

3.2.1.9. Benchmarking

Often one has two (or multiple) data of different frequency for the same target variable. Sometimes, however, these data are not coherent in the sense that they don’t match up. Benchmarking19 is a method to overcome this situation. It happens quite often, as aggregate of higher-frequency measurement is not necessarily equal to the less-aggregated measurement. Moreover, the sources of data may have different reliability. Usually it is thought that less frequent data are more

19 Description of the idea of benchmarking is based on Dagum, B.E., Cholette, P.A. 1994), and Quenneville, B. et all (2003). Detailed information can be found in: Dagum, B.E., Cholette, P.A. (2006).

75

trustworthy as they are based on larger samples and compiled more precisely. In general, the more reliable measurements are considered as benchmarks.

In seasonal adjustment methods benchmarking means the procedure that ensures the consistency over the year between adjusted and non-seasonally adjusted data. It should be noted that the ESS Guidelines on Seasonal Adjustment (2015) does not recommend benchmarking as it introduces a bias in the seasonally adjusted data. Also the U.S. Census Bureau points out that "forcing the seasonal adjustment totals to be the same as the original series annual totals can degrade the quality of the seasonal adjustment, especially when the seasonal pattern is undergoing change. It is not natural if trading day adjustment is performed because the aggregate trading day effect over a year is variable and moderately different from zero"20. Nevertheless, some users may prefer that the annual totals of the seasonally adjusted series match the annual totals of the original, non-seasonally adjusted series22.

According to the ESS Guidelines on Seasonal Adjustment (2015), the only benefit of this approach is that there is consistency over the year between adjusted and the non-seasonally adjusted data; this can be of particular interest when low-frequency (e.g. annual) benchmarking figures officially exist (e.g. National Accounts, Balance of Payments, External Trade, etc.) where users' needs for time consistency are stronger.

1. Following the ESS Guidelines on Seasonal Adjustment (2015) recommendations, by default, the benchmarking functionality is not applied (the Benchmarking node is empty). To activate it, click on the Specifications button and activate the checkbox in the Benchmarking section.

Figure 3.88: Benchmarking option – a default view. 2. Three parameters can be set here. Target specifies the target variable for the benchmarking procedure. It can be Original (the raw time series are considered as target data) or Calendar Adjusted (the time series adjusted for the calendar effects are considered as target data). Rho is

20 X-12-ARIMA Reference Manual (2011). 22 Hood, C.C. (2005).

76

a value of the AR(1) parameter (set between 0 and 1). By default it is set to 1. Finally, Lambda is a parameter that relates to the weights in the regression equation. It is typically equal to 0 (for an additive decomposition), 0.5 (for a proportional decomposition) or 1 (for a multiplicative decomposition). The default value is 1.

3. To launch the benchmarking procedure click on the apply button. The results are displayed on four panels. The top-left one compares the original product of a seasonal adjustment procedure with the result from applying a benchmarking to the seasonal adjustment. The bottom-left panel highlights the differences between these two results. The outcomes are also presented in a table on the top-right panel. The relevant statistics concerning relative differences are presented in the bottom-right panel.

Figure 3.89: The results of the benchmarking procedure.

4. Both pictures and the table can be copied in the usual way (see 2.1.4 and 3.1.1).

77

Figure 3.90: Options for benchmarking results.

5. The result of the benchmarking procedure (benchmarking.result) and the target data (benchmarking.target) can be also exported to the Excel file (see 3.1.2).

Figure 3.91: Exporting the results of the benchmarking procedure.

3.2.2. Detailed seasonal adjustment of multiple time series

This part guides the user through useful functions that can be used in the regular production of seasonally adjusted data, like summarising the results, saving and refreshing options. This part is divided into several case studies. Each of them focuses on a given issue and presents available options.

78

As prerequisite, the 3.1.2 scenario should be studied. The specification for each series included in the multi-document can be modified using the case studies presented in 3.2.1. Although the case studies presented in this section are intended for the datasets, they can be also performed for a single time series, provided that the analysis is done in a multi-document (the user is expected to follow the path Statistical methods → Seasonal adjustment → Multi Processing → New).

Links to the appropriate parts of the JDemetra+ Reference Manual (2017) for detailed explanations on actions to be provided when necessary.

Once a seasonal adjustment process for multiple time series is initiated a relevant item appears in the main menu. It includes the following options:

▪ Default specification – displays a list of pre-defined specifications. ▪ Start – runs the defined seasonal adjustment process. The item is active when some of the series included into SA-Processing window are unprocessed. ▪ Refresh – refresh a process with new data. Option is active when the previously saved workspace is opened and a relevant multi-document opened. For description of the Refresh options refer to 3.2.2.3. ▪ Accept – for a time series marked in the SA-Processing window this option sets the Quality value to Accepted. This option is helpful when the user wish to indicate the series for which the results have been reviewed and accepted by the user. ▪ Edit – allows to modify the content of the specification by Copy, Copy Series, Paste, Delete and Cut the time series that is marked in the multi-processing window. ▪ Clear selection – unmarks series selected in the SA-Processing window. ▪ Specification… – enables to pick the seasonal adjustment specification from the list. The chosen specification will be applied to the time series added to the processing afterwards. ▪ Priority – an indicator that can be used to mark series that require more or less attention. Priorities take values from 0 to 10. JDemetra+ computes them automatically, based on the average of the (logged) series. The user can choose the method of computation (log-based or level based). ▪ Initial order – displays times series on the list in initial order. The option restores the initial order if the list has been sorted by given column (e.g. by quality or method). ▪ Output… – offers a set of output formats (TXT, XLS, ODBC, CSV, CSV matrix), the choice of the folder that will contain the results and the content of the exported file. ▪ Report… – displays a summary report concerning the processing, including, e.g. number of series, specifications used, models used, diagnostic results.

79

Figure 3.92: SAProcessing menu.

3.2.2.1. Output options

1. Once a seasonal adjustment process for the dataset is performed the results can be exported to the external file. Go to the main menu and follow the path: SAProcessing → Output…

2. In the Batch output window the user can specify which output items will be saved and the folder in which JDemetra+ saves the results. It is possible to save the results in the TXT, XLS, CSV, and CSV matrix formats. In the first step the user should choose the output format from the list.

Figure 3.93: Default output formats.

3. The user may choose more than one format as the output can be generated in different formats at the same time.

80

Figure 3.94: Adding an output format to the list.

4. To display and modify the settings click on the given output format on the list. The available options depend on the output format.

5. For Csv format the following options are available: folder (location of the file), file prefix (name of the file), presentation (controls how the output is divided into separate files) and series (series included in the file). These options are presented in the next points of this case study.

Figure 3.95: Options for a Csv format.

6. The user can define the folder in which the selected results and components will be saved (click the folder item and choose the final destination).

81

Figure 3.96: Specifying a destination folder.

7. With the option File Prefix the user can modify the default name of the output saved in the CSV file.

Figure 3.97: Setting a File Prefix option.

8. Layout controls how the output is divided into separate files. Expand the list to display available options:

▪ HTable – the output series will be presented in the form of horizontal tables (time series in rows).

82

▪ VTable – the output series will be presented in the form of vertical tables (time series in columns).

▪ List – the output series will be presented in the form of vertical tables (time series in rows). Apart from that, for each time series each file contains in separate columns: the data frequency, the first year and of estimation span, the first period (month or quarter) of observation span and the number of observations. The files do not include dates.

Figure 3.98: Layout options for a Csv format.

9. The Content section presents a list of series that will be included into set of output files. The list of available codes is given in the JDemetra+ Reference Manual, section 7.7. To modify the initial settings click on the grey button in the Content section. The CVS-series window presents two panels: the panel on the left includes a list of all valuable output items. The panel on the right presents the selected output items. Mark the series and use the arrows to change the settings. Confirm your choice with the OK button.

83

Figure 3.99: Specifying a content of the output file.

10. Options available for the XLS format are the same as for the TXT format with an exception of the Layout section. The list of available codes in the Content section is given in the JDemetra+ Reference Manual, section 7.7.

▪ BySeries – all results for a given time series are placed in one sheet; ▪ ByComponent – results are grouped by components. Each component’ type is saved in a separate sheet. ▪ OneSheet – all results are saved in one sheet.

Figure 3.100: Layout options for an Excel format.

11. If the user sets the option layout to ByComponent, the output will be generated as follows:

84

Figure 3.101: An Excel file view for the ByComponent option.

12. The option OneSheet will produce the following XLS file:

Figure 3.102: An Excel file view for the OneSheet option.

13. By default, the series in the Excel output files are organised vertically. When the user unmark the check box the horizontal orientation is used.

Figure 3.103: The VerticalOrientation option.

85

14. In case of the TXT format the only available options are folder (location of the file) and series (results included in the output file). The list of available codes in the Content section is given in the JDemetra+ Reference Manual, section 7.7.

Figure 3.104: Options for the Txt output.

15. The CSV matrix produces the CSV file containing information about the model and quality diagnostics of the seasonal adjustment. The user may generate the list of default items or create their own quality report. By default, all the available items are included in the output. The list of the items is given in the JDemetra+ Reference Manual, section 7.7.

Figure 3.105: List of items available for the Csv matrix output type.

86

16. Once the output settings are introduced, click the OK button.

Figure 3.106: Options for the Csv matrix output.

17. For each output format JDemetra+ informs about the status of the operation. An exemplary message in presented below.

Figure 3.107: Generating output process result.

3.2.2.2. Revision policies

The saved results from the seasonal adjustment multi-process can be refreshed when new or modified observations are available. JDemetra+ offers several options for refreshing the output, which are in line with the ESS Guidelines on Seasonal Adjustment (2015) requirements.

87

1. To refresh the results open previously saved workspace using the path File → Open Workspace. Choose the multi-document from the Workspace window (see 2.1.1) and double click on it to display the multi-document menu (SAProcessing).

Figure 3.108: Opening a multi-document.

2. Several refreshment options are available.

Figure 3.109: The Refresh menu.

The meaning of the consecutive options is presented in the following table.

Option Meaning

The ARIMA model, outliers and other regression parameters are not re-identified and the values of Partial concurrent adjustment → Fixed model all parameters are fixed. The transformation type remains unchanged.

88

The ARIMA model, outliers and other regression parameters are not re-identified. The coefficients Partial concurrent adjustment → Estimate of the ARIMA model are fixed, other coefficients regression coefficients are re-estimated. The transformation type remains unchanged. The ARIMA model, outliers and other regression Partial concurrent adjustment → Estimate parameters are not re-identified. All parameters of regression coefficients + Arima parameters the RegARIMA model are re-estimated. The transformation type remains unchanged. The ARIMA model, outliers (except from the outliers in the last year of the sample) and other regression parameters are not re-identified. All Partial concurrent adjustment → Estimate parameters of the RegARIMA model are re- regression coefficients + Last outliers estimated. The outliers in the last year of the sample are re-identified. The transformation type remains unchanged. The ARIMA model and regression parameters, except from outliers) are not re-identified. All Partial concurrent adjustment → Estimate parameters of the RegARIMA model are re- regression coefficients + all outliers estimated. All outliers are re-identified. The transformation type remains unchanged. Re-identification of the ARIMA model, outliers Partial concurrent adjustment → Estimate and regression variables, except from the calendar regression coefficients + Arima model variables. The transformation type remains unchanged. Concurrent Re-identification of all the RegARIMA model. 3.2.2.2.1. Partial concurrent adjustment

According to the ESS Guidelines on Seasonal Adjustment (2015), partial concurrent adjustment is the strategy in which the model, filters, outliers and calendar regressors are re-identified once a year and the respective parameters and factors re-estimated every time a new or revised data become available. JDemetra+ offers several types of partial concurrent adjustment.

3.2.2.2.1.1. Partial concurrent adjustment → Fixed model

The Partial concurrent adjustment → Fixed model strategy means that the ARIMA model, outliers and other regression parameters are not re-identified and the values of the parameters are fixed. In particular, no new outliers or calendar variables are added to the model as well as no changes neither in the calendar variables nor in the outliers’ types are allowed. The transformation type remains unchanged.

89

The picture below presents the initial model (on the left) and the results of the refreshment procedure with the Partial concurrent adjustment → Fixed model option (on the right). The parameters of the ARIMA part are not estimated and their values are the same as before. The trading days and outliers are fixed too and no new regression effects are identified.

Figure 3.110: A Partial concurrent adjustment → fixed model revision policy results.

3.2.2.2.1.2. Partial concurrent adjustment → Estimate regression coefficients

The Partial current adjustment → Estimate regression coefficients option means that the ARIMA model, outliers and other regression parameters are not re-identified. The coefficients of the ARIMA model are fixed, other coefficients are re-estimated. In particular, no new outliers or calendar variables are added to the model as well as no changes neither in the calendar variables nor in the outliers’ types are allowed. The transformation type remains unchanged.

90

The picture below presents the initial model (on the left) and the results of the refreshment procedure with the Partial concurrent adjustment → Estimate regression coefficients option (on the right). The number of estimated parameters is 16 in the initial model and 14 in the revised model (the parameters of the ARIMA model are not estimated.

Figure 3.111: The Partial concurrent adjustment → Estimate regression coefficients revision policy results. 3.2.2.2.1.3. Partial concurrent adjustment → Estimate regression coefficient + Arima parameters

The Partial concurrent adjustment → Estimate regression coefficient + Arima parameters strategy means that the ARIMA model, outliers and other regression parameters are not re-identified. All

91

parameters of the RegARIMA model are re-estimated but the explanatory variables remain the same. The transformation type remains unchanged.

The picture below presents the initial model (on the left) and the results of the refreshment procedure with the Partial concurrent adjustment → Estimate regression coefficient + Arima parameters option (on the right). The parameters of the ARIMA part have been re-estimated and their values have been updated. Also regression coefficients have been re-estimated and the number of estimated coefficients in the revised model is the same as in the initial model (i.e. 16 estimated coefficients). The structure of the model remains unchanged while all coefficients have been updated.

Figure 3.112: The Partial concurrent adjustment → Estimate regression coefficient + Arima parameters revision policy results.

92

Partial concurrent adjustment →

Partial concurrent adjustment 3.2.2.2.1.4. Estimate regression coefficient + Last outliers

The → Estimate regression coefficient + Last outliers strategy means that the ARIMA model, outliers (except from the outliers in the last year of the sample) and other regression parameters are not re-identified. All parameters of the RegARIMA model are re- estimated. Software tests for the outliers in the last year of a data span and include in the model those which are statistically significant. The transformation type remains unchanged.

The picture below presents the initial model (on the left) and the results of the refreshment procedure with the Partial concurrent adjustment → Estimate regression coefficient + Last outliers option (on the right). The parameters of the ARIMA part have been re-estimated and their values have been updated. Also regression coefficients have been re-estimated. The number of estimated coefficients in the revised model is larger than the initial model because an additional outlier has been identified in the last year of a data span.

93

Figure 3.113: The Partial concurrent adjustment → Estimate regression coefficient + Last outliers revision policy results.

94

Partial concurrent adjustment →

Partial concurrent adjustment 3.2.2.2.1.5. Estimate regression coefficient + outliers

The → Estimate regression coefficient + outliers option means that the ARIMA model and regression parameters, except from the parameters for the outliers, are not reidentified. The parameters of these variables are re-estimated. All outliers are re-identified, i.e. the previous outcome of the outlier detection procedure is not taken into account and all outliers are identified and estimated once again. The transformation type remains unchanged.

The picture below presents the initial model (on the left) and the results of the refreshment procedure with the Partial concurrent adjustment → Estimate regression coefficient + outliers option (on the right). The parameters of the ARIMA part have been re-estimated and their values have been updated. Also regression coefficients for the calendar variables have been re-estimated. In the revised model there is no Prespecified outliers section. Instead, the outliers were re-identified.

95

Figure 3.114: The Partial concurrent adjustment → Estimate regression coefficient + outliers revision policy results. 3.2.2.2.1.6. Estimate regression coefficient + Arima model

The → Estimate regression coefficient + Arima model option means that

96

Partial concurrent adjustment →

Partial concurrent adjustment the ARIMA model, outliers and regression variables, except from the calendar variables are reidentified. All parameters are re-estimated. The transformation type remains unchanged.

The picture below presents the initial model (on the left) and the results of the refreshment procedure with the Partial concurrent adjustment → Estimate regression coefficient + Arima model option (on the right). The parameters of the ARIMA part have been re-estimated and their values have been updated. Also regression coefficients for the calendar variables have been re-estimated. In the revised model there is no Prespecified outliers section. Instead, the outliers were re-identified.

The picture below presents the initial model (on the left) and the results of the refreshment procedure for the concurrent adjustment → Estimate regression coefficient + Arima model option (on the right). The ARIMA part have been re-identified (a change from (2,1,0)(0,1,1) to (0,1,1)(1,1,1)). In contrast to the initial model, in the updated model the mean effect was detected and estimated. Also the results of the automatic outlier identification are not the same in both models.

97

Figure 3.115: The Partial concurrent adjustment → Estimate regression coefficient + Arima model revision policy results.

3.2.2.2.2. Concurrent adjustment

According to the ESS Guidelines on Seasonal Adjustment (2015), concurrent adjustment means that the model, filters, outliers, regression parameters and transformation type are re-identified and the respective parameters and factors re-estimated every time new observation is available. This option in JDemetra+ means that the completely new model is identified, and the previous results are not taken into account.

98

The picture below presents the initial model (on the left) and the results of the refreshment procedure with the Concurrent adjustment option (on the right). The transformation type has changed from none to log. The ARIMA part have been re-identified (a change from (0,1,1)(1,1,0) to (1,1,0)(0,1,1)). In contrast to the initial model, in the updated model the trading days and a leap year effect have been not estimated. Also the results of the automatic outlier identification are not the same in both models.

Figure 3.116: The Concurrent adjustment revision policy results. 3.3. Time series modelling

Time series modelling scenarios are designed for a time series analysis that includes identification and estimation of an ARIMA model as well as abnormal values and calendar effects. It is done by

99

applying automatic model identification procedures implemented in the pre-processing parts of TRAMO/SEATS and X-13ARIMA-SEATS. These scenarios enable an analysis of time series characteristics. There are two scenarios, Advanced time series analysis and Basic time series analysis; they differ in terms of user intervention, amount of an output produced and saving options.

3.3.1. Basic time series analysis

The aim of this scenario is to present the steps required in JDemetra+ for identifying regression effects in a purely automatic way (i.e. using pre-defined specifications, see the JDemetra+ Reference Manual (2017), item 4.1). Links to appropriate parts of the JDemetra+ Reference Manual (2017) are included for further details.

1. Go to the main menu and follow the path: Statistical methods → Anomaly Detection → Outliers Detection. JDemetra+ opens an empty Outliers Detection window.

Figure 3.117: Activating the Outliers detection option.

2. To display the default settings choose the Properties item from the Window menu. The default settings are visible in the Outliers Detection - Properties window. The user can modify the specification used for an outlier detection (Default Specification), use a default critical value for an outlier detection or change it (enter new critical value into a Critical value box) and choose a transformation type (see 3.2.1.6). In the Outliers to display section one can decide which outlier’s types are considered in the identification procedure. The outliers are described in the JDemetra+ Reference Manual (2017), item 7.1.1.

100

Figure 3.118: The settings for outliers’ detection procedure.

3. By default, the pre-defined TR4 specification will be used for time series modelling. To learn about the settings used for this specification see the JDemetra+ Reference Manual (2017), item 4.1 or double click the TR4 item, which can be found in the Modelling → specifications → tramo branch of the Workspace window and study the settings in the TR4 window.

Figure 3.119: Investigating the settings of a pre-defined specification.

4. To change the specification click on the cell next to the Default Specification item and choose a specification from the list. Change other settings, if necessary.

101

Figure 3.120: The choice of the Default specification.

5. To start the modelling, drag and drop series from the Providers window to the Outliers detection window.

Figure 3.121: Starting an outlier detection.

6. To display the results of the modelling, click on the time series header. JDemetra+ shows the outcomes in the upper panel and the time series graph in the bottom panel. The results include selection criteria, estimated ARIMA model, identified outliers (see the JDemetra+ Reference Manual (2017), item 7.1.1) and calendar effects (see the JDemetra+ Reference Manual (2017), item 7.2).

102

Figure 3.122: Displaying the outlier detection results.

The results presented in the Outliers Detection window cannot be saved in a JDemetra+ workspace.

3.3.2. Advanced time series analysis

This scenario shows how to identify regression effects using the pre-defined or user-defined specifications (JDemetra+ Reference Manual (2017), item 4.1). It includes all capabilities from a pre- processing part of TRAMO and RegARIMA. It is flexible in specifying models, and the user can save results and refresh them with updated series.

1. Go to the main menu and follow the path: Statistical methods → Modelling → Single Analysis → Tramo/RegArima. The scenario works in the same way for both options (Tramo or RegArima, see the JDemetra+ Reference Manual (2017), Chapter 4). Here Tramo has been chosen.

Figure 3.123: Launching the modelling process for a single time series.

103

2. JDemetra+ opens an empty TramoDoc window.

Figure 3.124: The modelling window.

3. To start a modelling, drag a series from the Providers window drop it on the Drop data here box situated in the upper part of the TramoDoc window.

Figure 3.125: Choosing a time series for the modeling process.

4. The modelling process starts automatically. By default, a summary of the results is displayed in the TramoDoc-1 window. The diagnostics presented here are discussed in the JDemetra+ Reference Manual (2017), section 4.2. To explore the results, expand the tree in the TramoDoc-1 window and click on the selected item. The details will be displayed in the bottom part of the window. The results include the model selection criteria, the estimated ARIMA model, identified outliers (see the JDemetra+ Reference Manual (2017), item 7.1.1) and calendar effects (the JDemetra+ Reference Manual (2017), 7.2). Note that outliers and calendar effects are

104

presented only if specified in the model or if found automatically by the chosen modelling routine.

Figure 3.126: The modelling results.

5. In this example below the modelling is performed using the TRfull specification (when TRAMO is chosen) or TR4c specification (when RegARIMA is chosen).

Figure 3.127: Information concerning the specification used for the modelling process.

105

6. To change the specification open the properties dialog window by clicking on the Specifications button.

Figure 3.128: Specification details.

7. The Specifications panel presents settings that have been used to generate the current output.

Figure 3.129: Settings used in the current specification.

8. To change a given setting, click on it and choose an option from the list and/or enter a value. In the picture below the type of calendar effects is changed from WorkingDays to TradingDays.

106

Figure 3.130: Changing the specification.

9. To confirm the changes click on the Apply button in the bottom part of the window.

Figure 3.131: Confirming the changes to the specification.

10. The results in the panel on the left will be updated according to the changes introduced in the specification. Once the user has modified the default specification, the name visible in the upper part of the window is changed to TR, which indicates that the user-defined settings are used.

107

Figure 3.132: The impact of the changes in the specification to the modelling results.

11. To copy the time series modelling results go to the Pre-adjustment item. In the table click on the upper-left cell.

Figure 3.133: Copying the modelling results.

12. Copy the series by clicking the Copy item from the context menu or use the standard Ctrl+C keys. Other options from this menu are explained in the JDemetra+ Reference Manual (2017), item 4.1.2.

108

Figure 3.134: Copying the modelling results.

13. Paste the series to a destination file (see 3.1.1, point 13).

14. The quality of the modelling can be assessed by studying the Statistics and Out-of-sample test sections. The results are marked in green, yellow or red, depending on the result of statistical test used. Those in green denote that the problematic characteristic has not been detected (e.g. lack of normality of residuals, the autocorrelation in residuals). The outcome in yellow means that the test outcome is uncertain. The outcomes in red denote cases where an issue should be addressed. The user is expected to investigate the problematic test statistics and try to improve the model, so that no uncertain or rejected test results are present. The meaning of the displayed outcomes is discussed in the JDemetra+ Reference Manual (2017), item 4.2.

Figure 3.135: Diagnostic results – a time series modelling scenario.

109

15. To save the created document (named TramoDoc-1 in the provided example) select a Save Workspace As… item from the File menu.

Figure 3.136: Saving the advanced time series modelling results.

16. Enter the location, a workspace name and click Save.

Figure 3.137: Choosing a folder to save a workspace.

17. The document is visible in the Workspace window under the appropriate branch (tramo in the example shown in this scenario).

110

Figure 3.138: The location of a newly created document.

18. The document can be opened, deleted or renamed from the context menu (right-click on the document name). Edit comments is a functionality for adding and modifying short notes concerning a given time series. Refresh data is an option for updating the results. When the option Refresh data is activated, JDemetra+ refers to the data file and uses current version of data to perform the adjustment with the settings saved in the document (named TramoDoc-1 in this example).

3.4. Other tools

3.4.1. Seasonality tests

Seasonality tests play a fundamental role at different stages of the automatic model identification process used by TRAMO/SEATS. They are also crucial of an assessment of the results produced by X-13-ARIMA-SEATS. When this method is used, the seasonal component is estimated regardless the properties of the original time series. Therefore the user is expected to decide if the seasonality is present in the time series.

The scenario presented here helps to identify seasonal movements in the original time series using various tests available in JDemetra+. Its purpose is to check the presence of seasonal movements in the time series and decide whether it should be adjusted for them or not. Some explanations on the seasonality tests can be found in JDemetra+ Reference Manual (2017), item 7.6.3.

Go to the main menu and follow the path: Statistical methods → Seasonal Adjustment → Tools → Seasonality tests.

111

Figure 3.139: Opening a Seasonality test window.

1. JDemetra+ opens a Seasonality tests window. It contains two empty panels. Once an analysis of a time series has been performed, the upper one will show a time series graph and the lower one will present detailed results for seasonality tests.

Figure 3.140: The Seasonality Tests window.

2. To start the analysis, drag and drop one time series from the Providers window to the Drop data here area as shown below.

112

Figure 3.141: Launching the functionality.

3. The testing process starts automatically. The upper panel presents the time series graph. Once the given observation is pointed with a mouse, JDemetra+ displays its value and the relevant date.

Figure 3.142: Time series graph.

4. Using the local menu the user may adjust the view of the picture, save it and/or save it in a given location (for details see 2.1.3).

113

Figure 3.143: Local menu basic options for the time series graph.

5. By going to the main menu and choosing a path Window → Properties, one can re-run the tests with the alternative data transformations (logging and/or differencing) and a different sample size (option last years). When the option Last years is set to zero, the tests will be executed using all available observations. Be aware that the properties window displays the properties of an active item. Therefore, click on the time series graph in the picture below to display the properties correctly.

Figure 3.144: Seasonality tests options.

6. The diagnostic section in the bottom part of the window contains a summary table and detailed results for six seasonality tests. Study this section using the vertical scrollbar. The results are marked in green, yellow or red, depending on the result of statistical test used. In general, an outcome that appears in JDemetra+ interface in green indicates no evidence of a problem in a

114

tested area, yellow is uncertain and red indicates an issue that should be addressed. In this scenario results in green indicate that the given test detected seasonal movements. In case of the tests, for which p-values are given, green denotes that the desired test result was achieved at the 5% confidence level. An outcome in yellow means that the relevant test statistics can be accepted at the 1% level. An outcome in red denotes that the test statistic was rejected.

Figure 3.145: Seasonality tests results section.

7. The test on autocorrelation on seasonal lags is the Ljung-Box test that checks the correlation between the actual observation and observation lagged by one and two years. In the case of a monthly time series the autocorrelation between these values is denoted as ac(12) and ac(24) respectively. In case of a quarterly time series the autocorrelation between these values is denoted as ac(4) and ac(8) respectively. If the observations are independent from each other, they are distributed as 휒2. When this hypothesis is rejected, the significant autocorrelation is

115

confirmed, which is a sign of seasonal movements in the series and the test’s outcome is displayed in green.

Figure 3.146: Test on autocorrelations at seasonal lags.

8. The Friedman test is a non-parametric method for testing that samples are drawn from the same population or from populations with equal medians. In the regression equation the significance of the month (or quarter) effect is tested. The Friedman test requires no distributional assumptions. It uses the rankings of the observations. If the null hypothesis of no stable seasonality is rejected at the 0.1% significance level 푝푉푎푙푢푒 < 0.001, then the series is considered to be seasonal and the test’s outcome is displayed in green.

Figure 3.147: Non-parametric Friedman test.

116

9. The Kruskal-Wallis test is a non-parametric test used for comparing samples from two or more groups. The null hypothesis states that all months (or quarters, respectively) have the same mean. Under this hypothesis the test statistic follows a 휒2 distribution. When this hypothesis is rejected, it is assumed that time series values differ significantly between periods and the test’s results are displayed in green.

Figure 3.148: Non-parametric Kruskal-Wallis test.

10. The identification of seasonal peaks can also be carried out with the auto-regressive spectrum and Tukey periodogram. The autoregressive spectrum is based on the estimation of an AR(30) process, while the Tukey periodogram is a non-parametric estimator that introduces some degree of smoothing in the periodogram. In order to decide whether a the series has a seasonal component that is predictable (stable) enough the tests use visual criteria and formal tests that rely on two basic principles: a) the peaks associated to seasonal frequencies should be larger than the median spectrum for all frequencies and, b) the peaks should exceed the spectrum of the two adjacent values by more than a critical value. When such case is detected, the test results are displayed in green. The statistical significance of each one of the seasonal peaks (i.e. 휋 휋 휋 2휋 5휋 frequencies , , , , and 휋 corresponding to 1, 2, 3, 4, 5 and 6 cycles per year) is also dis- 6 3 2 3 6 played.

11. Auto-regressive spectrum is a test that originates from the X-13ARIMA-SEATS program. It is based on the spectral density (spectrum) function, which reformulates the content of the stationary time series’ autocovariances in terms of amplitudes at frequencies of half a cycle per month or less. Due to the possibly evolving nature of the seasonal movements the interval for spectrum estimation is the 96 most recent observations. The test checks if the series has a seasonal component that is predictable (stable) enough so that X-13ARIMA-SEATS can estimate it with reasonable success. When such a case is detected, the test’s result is displayed

117

in green. This test is available only for monthly data. In case of quarterly time series it is not displayed.

Figure 3.149: Identification of seasonal peaks in a Tukey periodogram and in an auto-regressive spectrum.

12. As opposed to the empirical criteria described in the previous point, one can use a formal test to assess the statistical significance of the periodogram’s peaks at seasonal frequencies. The test proposed is based on the sum of the values of the periodogram at seasonal frequencies, which follows a χ2(24) under the null hypothesis of an absence of seasonality.

Figure 3.150: A periodogram.

118

13. Finally, the test on regression with seasonal dummies checks the presence of deterministic seasonality. The first version of the test uses the seasonal dummies (mean effect and 11 dummies

for a monthly data, or 3 dummies for a quarterly data) in a RegARIMA model, in which the ARIMA part of the model has a form (0,1,1)(0,0,0). The test statistics checks if the seasonal dummies are jointly statistically insignificant. When this hypothesis is rejected, it is assumed that the deterministic seasonality is present and the test’s results are displayed in green.

Figure 3.151: Tests on regression with the fixed seasonal dummies.

14. In the second version of this test the regression is performed on an automatically identified ARIMA model instead of ARIMA (0,1,1)(0,0,0). The test statistics checks if the seasonal dummies are jointly statistically insignificant. The test statistics checks if the seasonal dummies are jointly statistically insignificant. When this hypothesis is rejected, it is assumed that the deterministic seasonality is present and the test’s results are displayed in green.

119

3.4.2. Spectral graphs

This scenario is designed for advanced users for an in-depth analysis of time series in the frequency domain using three spectral graphs. Those graphs can also be used as a complementary analysis to have a better understanding of the results obtained with some of the tests described above.

Economic time series are usually presented in a time domain (X-axis). However, for the analytical purposes it is convenient to convert the series to a frequency domain due to the fact that any stationary time series can be expressed as a combination of cosine (or sine) functions. These functions are characterized with different periods (amount of time to complete a full cycle) and amplitudes (maximum/minimum value during the cycle).

The tool used for the analysis of time series in a frequency domain is called a spectrum. The peaks in the spectrum indicate the presence of cyclical movements with periodicity between two months and one year. The series, which is thought seasonal, should have peaks at the seasonal frequencies. Calendar adjusted data are not expected have peak at a calendar frequency.

2휋 The periodicity of phenomenon at frequency 푓 is . It means that for a monthly time series the 푓 휋 휋 휋 2휋 5휋 seasonal frequencies , , , , and 휋 correspond to 1, 2, 3, 4, 5 and 6 cycles per year. For exam- 6 3 2 3 6 휋 ple, the frequency corresponds to a periodicity of 6 months (2 cycles per year are completed). For 3 휋 the quarterly series there are two seasonal frequencies: (one cycle per year) and 휋 (two cycles per 2 year). A peak at the zero frequency always corresponds to the trend component of the series. Seasonal frequencies are marked as grey vertical lines, while violet lines represent the trading-days frequencies. The trading day frequency is 0.348 and derives from the fact that a daily component which repeats every seven days goes through 4.348 cycles in a month of average length 30.4375 days. It is therefore seen to advance 0.348 cycles per month when the data are obtained at twelve equally spaced times in 365.25 days (the average length of a year).

The interpretation of the spectral graph is rather straightforward. When the values of a spectral graph for low frequencies (i.e. one year and more) are large in relation to its other values it means that the long-term movements dominate in the series. When the values of a spectral graph for high frequencies (i.e. below one year) are large in relation to its other values it means that the series are rather trendless and contains a lot of noise. When the values of a spectral graph are distributed randomly around a constant without any visible peaks, then it is highly probable that the series is a random process. The presence of seasonality in a time series is manifested in a spectral graph by the peaks on the seasonal frequencies.

120

1. The spectral graphs are available from: Tools → Spectral analysis.

Figure 3.152: Tools for spectral analysis.

2. When the first option is chosen JDemetra+ displays an empty Auto-regressive spectrum window. To start an analysis drag a single time series from the Providers window and drop it into the Drop data here area.

Figure 3.153: Launching an auto-regressive spectrum.

3. An auto-regressive spectrum graph available in JDemetra+ is based on the relevant tool from the X-13ARIMA-SEATS program. It shows the spectral density (spectrum) function, which reformulates the content of the stationary time series’ autocovariances in terms of amplitudes at frequencies of half a cycle per month or less. The number of observations, data transformations and other options such as the specification of the frequency grid and the order of the autoregresive polynomial (30 by default) can be specified by opening the Window → Properties from the main menu.

The Auto-regressive - Properties window contains the following options:

121

▪ Log – a log transformation of a time series;

▪ Differencing – transforms a data by calculating a regular (order 1,2..) or seasonal (order 4, 12, depending on the time series frequency) differences; ▪ Differencing lag – the number of lags that the program will use to take differences. For example, if Differencing lag = 3 then the differencing filter does not apply to the first lag (default) but to the third lag. ▪ Last years – a number of years at the end of the time series taken to produce autoregresive spectrum. By default, it is 0, which means that the whole time series is considered. ▪ Auto–regressive polynomial order – the number of lags in the AR model that is used to estimate the spectral density. By default, the order of the autoregressive polynomial is set to 30 lags.

= ▪ Resolution – the value 1 plots the spectral density estimate for the frequencies 휔푗 2

푛휋푗, where 푛 ∈ (−휋; 휋) is the size of the sample used to estimate the AR model. Increasing this value, which is set to 5 by default, will increase the precision of this grid.

Figure 3.154: Auto-regressive spectrum’s properties.

4. The seasonality test described above uses an empirical criterion to check whether the series has a seasonal component that is predictable (stable) enough that it can be estimated with reasonable success. The peak has to be greater than median of the 61 spectrum ordinates and

122

has to exceed the two adjacent spectral values by more than a critical value. When such a case is detected, the test results are displayed in green. For a detailed description of an auto- regressive spectrum see the JDemetra+ Reference Manual (2017), item 7.3.2.

Figure 3.155: An example of an-auto-regressive spectrum.

5. The second spectral graph is a periodogram. To perform the analysis of a single time series using this tool, choose Tools → Spectral analysis → Periodogram and drag and drop series from the Providers window to the empty Periodogram window.

Figure 3.156: Launching a periodogram.

The sample size and data transformations can be specified by opening the Window → Properties, in the main menu. The Periodogram - Properties window contains the following options:

▪ Log – a log transformation of a time series; ▪ Differencing – transforms a data by calculating regular (order 1,2..) or seasonal (order 4, 12, depending on the time series frequency) differences;

123

▪ Differencing lag – the number of lags that you will use to take differences. For example, if Differencing lag = 3 then the differencing filter does not apply to the first lag (default) but to the third lag. ▪ Last years – a number of years at the end of the time series taken to produce periodogram. By default it is 0, which means that the whole time series is considered.

Figure 3.157: Periodogram’s properties.

6. The periodogram is one of the earliest tools used for the analysis of time series in the frequency domain. It enables the user to identify the dominant periods (or frequencies) of a time series. In general, the periodogram is a wildly fluctuating estimate of the spectrum with a high variance and is less stable than an auto-regressive spectrum. For a detailed description of a periodogram see the JDemetra+ Reference Manual (2017), item 7.3.1.

124

Figure 3.158: An example of a periodogram.

7. The third spectral graph is a Tukey spectrum. To perform the analysis of time series using this tool, choose Tools → Spectral analysis → Tukey spectrum and drag and drop a single series from the Providers window to the empty Periodogram window.

Figure 3.159: Launching a Tukey spectrum.

8. The Tukey spectrum estimates the spectral density by smoothing the periodogram.

125

Figure 3.160: An example of a Tukey spectrum.

9. The options for the Tuckey window can be specified by opening the Window → Properties from the main menu. The Periodogram - Properties window contains the following options:

▪ Log – a log transformation of a time series. ▪ Differencing – transforms a data by calculating regular (order 1, 2..) or seasonal (order 4, 12, depending on the time series frequency) differences. ▪ Differencing lag – the number of lags that you will use to take differences. For example, if Differencing lag = 3 then the differencing filter does not apply to the first lag (default) but to the third lag. ▪ Taper part – parameter larger than 0 and smaller or equal to one that shapes the curvature of the smoothing function that is applied to the auto-covariance function. ▪ Window length – the size of the window that is used to smooth the auto-covariance function. The value zero considers the whole series.

▪ Window type – it refers to the weighting scheme that it is used to smooth the auto-covariance function. The available windows types (Square, Welch, Tukey, Barlett, Hamming, Parzen) are suitable to estimate the spectral density.

Figure 3.161: Tukey spectrum’s properties.

126

3.4.3. Calendars

This scenario presents how to define different kinds of calendars. These calendars can be applied to the specifications that take into account country-specific holidays and can be used for detecting and estimating the calendar effects.

The calendar effects are those parts of the movements in the time series that are caused by different number of weekdays in calendar months (or quarters). They arise as the number of occurrences of each day of the in a month (or a quarter) differs from year to year. These differences cause regular effects in some series. In particular, such variation is caused by a leap year effect because of an extra day inserted into February every four years. As with seasonal effects, it is desirable to estimate and remove calendar effects from the time series.

The calendar effects can be divided into a mean effect, a seasonal part and a structural part. The mean effect is independent from the period and therefore should be allocated to the trend-cycle. The seasonal part arises from the properties of the calendar that recur each year. For one thing, the number of working days of months with 31 calendar days is on average larger than that of months with 30 calendar days. This effect is part of the seasonal pattern captured by the seasonal component (with the exception of leap year effects). The structural part of the calendar effect remains to be determined by the calendar adjustment. For example, the number of working days of the same month in different years varies from year to year.

Both X-12-ARIMA/X-13ARIMA-SEATS and TRAMO/SEATS estimate calendar effects by adding some regressors to the equation estimated in the pre-processing part (RegARIMA or TRAMO, respectively). Regressors mentioned above are generated from the default calendar or the user defined calendar.

The calendars of JDemetra+ simply correspond to the usual trading days contrast variables based on the , modified to take into account some specific holidays. Those holidays are handled as "Sundays" and the variables are properly adjusted to take into account the long term mean effects.

1. Calendars in JDemetra+ are stored in the Workspace window in the Utilities section. By default, JDemetra+ does not contain any county-specific national holidays. The only item available here is the Default calendar, which assumes that apart from each Saturday and Sunday no other days are non-working days. The Default calendar reflects only usual composition of the in the calendar periods (months, quarters).

127

Figure 3.162: The Calendars section in the Workspace window.

2. To study the default calendar double click on it. The details are displayed in three panels, which present the properties settings, the actual calendar variables and the spectral graph for the selected (by default – the first one) calendar variable. By default, the view shown in the picture below is displayed.

Figure 3.163: The default view of the default calendar.

3. In the Properties panel the user can try different frequencies, variable type (trading days or working days21) and specify the variable span by defining the start date and a length of the series. The content of the other two panels will be adjusted automatically to these changes.

21 Trading Days – seven regression variables, which correspond to differences in economic activity between all days of the week and a leap year effect; Working Days – two regression variables, which correspond to differences in economic activity between the working days (Monday to Friday) and the non-working days (Saturday - Sunday) and a leap year effect.

128

For the Trading days option seven regression variables are created. The usual trading days variables are defined by the following transformation: 6 contrast variables (푛푢푚푏푒푟 표푓 푀표푛푑푎푦푠 − 푛푢푚푏푒푟 표푓 푆푢푛푑푎푦푠,…) are used with the length of periods that handle the leap year effect.

1 0 0 0 0 0 −1 푀 푀 − 푆 0 1 0 0 0 0 −1 푇 푇 − 푆 푊 − 푆 0 0 1 0 0 0 −1 푊 0 0 0 1 0 0 −1 푇 = 푇 − 푆 0 0 0 0 1 0 −1 퐹 퐹 − 푆 0 0 0 0 0 1 −1 푆푎푡 푆푎푡 − 푆 1 1 1 1 1 1 1 ] [ 푆 ] [퐿푒푛푔푡ℎ 표푓 푝푒푟푖표푑푠]

Figure 3.164: Modification of the initial settings for the Default calendar.

4. For the usual working days variables two variables are used: one contrast variable and the length of periods.

[1 − 5⁄2] [ 푊푒푒푘] = [퐿푒푛푔푡퐶표푛푡푟푎푠푡ℎ 표푓 푝푒푟푖표푑 푤푒푒푘 푠] 1 1 푊푒푒푘푒푛푑

The transformations used for creating the trading days variables and the working days variables have several advantages. They suppress from the contrast variables the mean and the seasonal effects, which are concentrated in the last variable. So, they lead to less correlated variables.

129

Figure 3.165: The working days variables in the Default calendar.

5. The top-right panel displays the spectrum for the given calendar variable. By default, the first variable from the table is shown. To change it, click on the calendar variable header.

The spectrum presents the series in the frequency domain (X-axis). The peaks in the spectrum indicate the frequency of cyclical movements with periodicity less than two months, which are 2휋 present in the time series. The periodicity of a phenomenon at frequency 푓 is . It means that 푓 휋 휋 휋 2휋 5휋 for a monthly time series the seasonal frequencies are: , , , , , 휋 (which are equivalent to 6 3 2 3 6

1, 2,... cycles per year i.e. in the case of a monthly series, the frequency 휋 corresponds to a 3 periodicity of 6 months (2 cycles per year are completed)). For the quarterly series there are 휋 two seasonal frequencies: (one cycle per year) and 휋 (two cycles per year). A peak at the zero 2 frequency always corresponds to the trend component of the series. The seasonal frequencies are marked as grey vertical lines, while violet lines represent the trading-days frequencies. The trading day frequency is 0.348 and derives from the fact that a daily component, which repeats every seven days, goes through 4.348 cycles in a month of an average length of 30.4375 days. It is therefore seen to advance 0.348 cycles per month when the data are obtained at twelve equally spaced times in 365.25 days (the average length of a year).

Calendar variables are not expected to have a peak neither at a zero frequency nor the seasonal frequencies. The presence and location of the peaks for the calendar variables should be checked when the user-defined calendar variables are considered.

130

Figure 3.166: Spectrum for a trading days variable.

6. Calendar variables can be copied/pasted to an Excel file. To do it, open an Excel file and click on the top-left cell in the panel on the left and drag and drop series the to the Excel file.

Figure 3.167: Copying the calendar variables by drag & drop.

7. A new calendar can be created through the user interface. This is a long process that will be described in the next three scenarios. Another option to create a calendar is importing the existing file to JDemetra+. To do it, right click on the Calendar item from the Workspace window and choose the Import item from the menu.

131

Figure 3.168: Importing a calendar to JDemetra+.

8. The example of the file containing a calendar is presented below.

Figure 3.169: An example of the Calendars file.

9. To import the file containing the calendar choose the appropriate file and open it.

132

Figure 3.170: Choosing the file.

10. JDemetra+ adds the calendar to the list.

Figure 3.171: A list of calendars with a newly imported calendar.

11. To change the existing calendar click the option Edit from the context menu, as it has been shown above. JDemetra+ displays the list of the holidays that have been defined for this calendar.

133

Figure 3.172: Edit a calendar window.

12. To add a holiday to the calendar unfold the "+" menu. To remove a holiday from the list click on it and choose the "-" button. To remove the existing holiday from the list, click on it and press the "-" button. Once all changes are introduced, click OK. More details are given in 3.4.3.1.

134

Figure 3.173: Removing a holiday from the calendar.

13. To adjust the series for the country-specific calendar effects, the appropriate calendar needs to be created. To do it, right click on the Calendar item from the Workspace window and choose the Add Calendar item from the menu.

Figure 3.174: Adding a calendar.

Three options are available here:

▪ National calendars, which is appropriate to define a calendar that includes country-specific holidays; ▪ Composite calendars, which is an option designed e.g. for a seasonal adjustment of an aggregated time series that are composed of national data. It enables to create a calendar that is a weighted sum of several national calendars.

135

▪ Chained calendars, defined by two national calendars and a break date.

These options are considered in the separate sub-scenarios. Study the one that match your needs.

3.4.3.1. National calendar

1. To define the national calendar, choose the option Add Calendar → National from the context menu that is available for the Calendars item in the Workspace window. Input the name of the calendar into the Name box. To add a holiday to the calendar unfold the "+" menu. To remove a holiday from the list click on it and choose the "-" button.

Figure 3.175: Creating a national calendar – the initial window.

Four options are available here: ▪ Fixed – defines a holiday as a specific day in the year that occurs always at the same day of the month; ▪ Easter Related – denotes a holiday that depends on Easter; ▪ Fixed Week – creates a fixed holiday that always falls in a specific week of the specific month; ▪ Special Day – enables to choose a holiday from the list of pre-defined holidays, which includes the commonly used moving and constant holidays. 2. The definition of the calendar effects described in this scenario lead to regression variables that have a mean effect (i.e. the effect that is independent of the period). In the usual decomposition of a series this effect should be allocated to the trend-cycle component, so the actual calendar effect should only contain effects that do not belong to the other components. The mean effect

136

of a calendar variable is the average number of days in its group. Taking into account that one

year has on average 365.25 days, the monthly mean effects for Working days are: × =

21.7411 for week days, × = 8.696 for weekends, = 30.4375 in total. As a result of the facts presented above, the Long term mean correction box should be always marked when a calendar is being defined.

Figure 3.176: A long term mean correction.

3. When the user wants to include Easter, which date derives from the , the Julian Easter checkbox should be marked. By default, the checkbox is unmarked.

Figure 3.177: A Julian Easter option.

137

4. The holidays that are celebrated in many European countries and in the USA are included in the Special days list. Their definitions are given in the table below.

Holiday Definition New Year Fixed holiday, falls on January, 1. Ash Wednesday Moving holiday, occurring 46 days before Easter. Easter Moving holiday, varies between March, 22 and April, 25. Maundy Thursday Moving holiday, falls on the Thursday before Easter. Good Friday Moving holiday, falls on the Friday before Easter. Easter Monday Moving holiday, falls on the day after Easter. Ascension Day Moving holiday, celebrated on Thursday, 40 days after Easter. Pentecost Moving holiday, celebrated 50 days after Easter Sunday. Whit Monday Moving holiday, falling on the day after Pentecost. May Day Fixed holiday, falls on May, 1. Assumption Fixed holiday, falls on August, 15. Halloween Fixed holiday, falls on October, 31. All Saints Day Fixed holiday, falls on November, 1. Moving holiday, celebrated on the second Monday of October Thanksgiving (Canada) or on the fourth Thursday of November (United States). Christmas Day Fixed holiday, falls on December, 25. To add a holiday from this list to the national calendar, choose the Special day item from the Special days list.

138

Figure 3.178: Adding a pre-defined holiday to the calendar. 5. By default, when Special Days option is selected, JDemetra+ always adds Christmas to the list of selected holidays. The user can change this initial choice by specifying the settings in the panel on the right and clicking OK. The settings that can be changed include:

▪ Start – the start date of the holiday. The default is the start date of the calendar (empty cell). Date specified by the user should be entered in the format yyyy-mm-dd. ▪ End – the end date of the holiday. The default is the end date of the calendar (empty cell). Date specified by the user should be entered in the format yyyy-mm-dd. ▪ Weight – specifies the impact of the holiday on the series. The default weight parameter value is 1 (full weight), which means that the influence of the day is the same as a regular Sunday. If the particular holiday affects the time series less than a regular Sunday, a value between 0 and 1 can be assigned. This decision, however, should be based on expert knowledge and/or practical studies. ▪ Day event – a list of pre-defined holidays. ▪ Offset – The position of the holiday in relation to the selected pre-specified holiday measured in days. By default, the offset is 1. It can be positive or negative. The positive offset denotes a holiday that is followed by the selected pre-specified holiday. On the contrary, the negative offset means that the holiday is preceding the selected pre-specified holiday by the offset value.

139

Figure 3.179: Choosing a pre-defined holiday from the list.

6. To define a fixed holiday, which is not included in the list of pre-defined holidays, choose Fixed from the Special days list. By default, JDemetra+ always displays here 1st of January. The user

can change this initial choice by specifying the settings in the panel on the right. These settings include:

▪ Start – the start date of the holiday. The default is the start date of the calendar (empty cell). Date specified by the user should be entered in the format yyyy-mm-dd. ▪ End – the end date of the holiday. The default is the end date of the calendar (empty cell). Date specified by the user should be entered in the format yyyy-mm-dd. ▪ Weight – specifies the impact of the holiday on the series. The default weight parameter value is 1 (full weight), which means that the influence of the day is the same as a regular Sunday. If the particular holiday affects the time series less than a regular Sunday, a value between 0 and 1 can be assigned. This decision, however, should be based on expert knowledge and/or practical studies. ▪ Day – the day of month when the fixed holiday is celebrated. ▪ Month – the month, in which the fixed holiday is celebrated.

140

Figure 3.180: Options for a fixed holiday.

7. The example below shows how to define an Epiphany, which is a holiday celebrated in Poland from 2011 onwards. To modify the values of the parameters click on the appropriate cell and insert values (Start, End, Weight, Day) or choose an item from the list (Month). JDemetra+ signals if the parameter value is allowed (parameter displayed in green) or not (parameter displayed in red).

Figure 3.181: Adding a fixed holiday to the calendar.

8. Most events connected with Easter are included in the special day list of the pre-defined holidays. The list of pre-defined holidays does not include Corpus Christi, which is a moving

141

holiday celebrated in some countries 60 days after Easter. To add this holiday or other Easter related event to the calendar, choose Easter related item from the Special days list.

Figure 3.182: Defining an Easter related holiday.

9. To define an Easter related holiday, which is not included in the list of pre-defined holidays, choose Easter related item from the Special days list. By default JDemetra+ always displays here Easter + 1. The user can change this initial choice by specifying the settings in the panel on the right. These settings include:

▪ Start – the start date of the holiday. The default is the start date of the calendar (empty cell). Date specified by the user should be entered in the format yyyy-mm-dd. ▪ End – the end date of the holiday. The default is the end date of the calendar (empty cell). Date specified by the user should be entered in the format yyyy-mm-dd. ▪ Weight – specifies the impact of the holiday on the series. The default weight parameter value is 1 (full weight), which means that the influence of the day is the same as a regular Sunday. If the particular holiday affects the time series less than a regular Sunday, a value between 0 and 1 can be assigned. This decision, however, should be based on expert knowledge and/or practical studies. ▪ Offset – The position of the holiday in relation to the selected pre-specified holiday measured in days. By default, the offset is 1. It can be positive or negative. The positive offset denotes a holiday that is followed by the selected pre-specified holiday. On the contrary, the negative offset means that the holiday is preceding the selected pre-specified holiday by the offset value.

142

To define Corpus Christi enter 60 into the Offset cell. Corpus Christi has always been celebrated in Poland; therefore the validity period (Start and End) should be left empty. Confirm your choice by clicking OK.

Figure 3.183: Changing a default offset settings for an Easter related holiday.

10. The fixed week option is useful for dealing with holidays that always falls on the same week of the given month. An example of such holiday is Labour Day that is celebrated on the first Monday of September in Canada. To introduce such an event choose Fixed Week item from the Special days list.

Figure 3.184: Adding a fixed week holiday to the calendar.

11. For a fixed week, the following parameters should be entered:

143

▪ Start – the start date of the holiday. The default is the start date of the calendar (empty cell). Date specified by the user should be entered in the format yyyy-mm-dd. ▪ End – the end date of the holiday. The default is the end date of the calendar (empty cell). Date specified by the user should be entered in the format yyyy-mm-dd. ▪ Weight – specifies the impact of the holiday on the series. The default weight parameter value is 1 (full weight), which means that the influence of the day is the same as a regular Sunday. If the particular holiday affects the time series less than a regular Sunday, a value between 0 and 1 can be assigned. This decision, however, should be based on expert knowledge and/or practical studies. ▪ Day of Week – the day of week when the holiday is celebrated each year. ▪ Month – the month, in which the fixed holidays is celebrated each year. ▪ Week – the number of the week in the month when the holiday is celebrated. Should be between 1 and 5. Once the changes are made, click OK.

Figure 3.185: Defining a fixed week holiday.

12. The list of the holidays should contain only unique entries. Otherwise, a warning, as shown in the picture below, will be displayed.

144

Figure 3.186: Duplicated events.

13. A calendar without a name cannot be saved. Fill the Name box before saving the calendar.

Figure 3.187: A no-name calendar.

14. The final view of the properly defined calendar for Poland is presented below. Click OK to save the calendar.

145

Figure 3.188: Saving the national calendar.

15. The calendar is visible in the Workspace window. To display the available options right-click on it. The national calendar can be edited, duplicated (to create another calendar) deleted and analysed (double click to display it in the panel on the right).

Figure 3.189: Options for a national calendar.

146

3.4.3.2. Chained calendar

A chained calendar is an option that can be used when huge changes in the composition of the holidays take place. In such case two calendars that describe situation before and after the change of regime can be defined. Poland experienced an introduction of new holidays in 1990. This case can be captured by defining two calendars that include two sets of holidays. The final Polish calendar is then defined as a chained calendar by specifying two calendars and a break date.

1. To create the chained calendar, first define two national calendars, following scenario 3.4.3.1. The two calendars will appear in the Workspace panel.

Figure 3.190: Defining the national calendars to be used for a chained calendar.

2. Right-click on the Calendars item and choose the Add Calendar → Chained option.

Figure 3.191: Creating a chained calendar.

147

3. In the Properties panel specify the first and the second calendar as well as a break date. Click OK to create a chained calendar.

Figure 3.192: Specifying the properties of a chained calendar.

3.4.3.3. Composite calendar

A composite calendar is an option that is useful for series that includes data from more than one country/region. This option can be used, for example, to create the calendar for the European Union or to create the national calendar for a country, in which regional holidays are celebrated. For example, in Germany public holidays are determined by the federal states. Therefore, Epiphany is celebrated only in Baden-Württemberg, Bavaria and in Saxony-Anhalt, while from 1994 Day of Repentance and Prayer is celebrated only in Saxony.

1. To create a composite calendar, first the calendars for each member state/region are to be created by using the option National calendar. The picture below shows a list of calendars that describe each of the sixteen German federal states.

148

Figure 3.193: A list of national calendars.

2. A composite calendar can be created by right-clicking on the Calendars item and choosing the option Add Calendars → Composite from the local menu.

Figure 3.194: Creating a composite calendar.

3. Fill the name box and mark the national calendars that will be used to create a composite calendar. Assign a weight to each calendar. This weight should indicate the share of a given item in the total value that will be analysed using the composite calendar. In the strict sense, these weights differ between investigated series as well as over time. For practical reasons one might consider, for example, the composite calendar on a pro rata basis according to the share

149

of employees in the federal states affected in each case. The weights in the example below are chosen arbitrarily. After setting the weights, click OK to save the calendar.

Figure 3.195: Defining a composite calendar.

4. The newly created calendar is visible on the list. It can be edited, cloned, exported or removed. These options are available from the local menu (right-click).

150

Figure 3.196: The options available for a composite calendar.

4. References

Caporello, G., and Maravall, A. (2004), Program TSW: Revised Reference Manual, Working Paper 0408, Servicio de Estudios, Banco de España.

Chatfield, C. (2004), The Analysis of Time Series: An Introduction, Sixth Edition, Chapman and Hall/CRC.

Dagum, E.B.D. (1980), The X-11-ARIMA seasonal adjustment method, Statistics Canada.

Dagum, B. E. and Cholette P. A. (1994), Benchmarking Time Series with Autocorrelated Survey Errors, International Statistical Review, Revue Internationale de Statistique, Volume 62, Number 3, December 1994.

Dagum, B.E. and Cholette, P.A. (2006), Benchmarking, Temporal Distribution, and Reconciliation Methods for Time Series, Lecture Notes in Statistics, Vol. 186, Springer, New York.

(2015), ESS Guidelines on Seasonal Adjustment, Eurostat Methodological Working Papers, http://ec.europa.eu/eurostat/documents/3859598/6830795/KS-GQ-15-001-EN-N.pdf.

Gómez, V., and Maravall, A. (1998), Automatic modelling methods for univariate Series, Banco de España - Servicio de Estudios, Documento de Trabajo nº 9808.

Grudkowska, S. (2017), JDemetra+ Reference Manual, Eurostat, http://cros-portal.eu/.

Hood, C.C. (2005), An Empirical Comparison of Methods for Benchmarking Seasonally Adjusted Series to Annual Totals, ASA proceedings.

Quenneville, B., Ladiray, D. and Lefrancois, B. (2003), A note on Musgrave asymmetrical trend-cycle filters, International Journal of Forecasting, 19, 727-734.

Kaiser, R., Maravall, A. (2003), Seasonal outliers in time series, Journal of the Inter-American Statistical Institute, 15, 101-142.

(2007), Guide to seasonal adjustment with X-12-ARIMA (draft), Office for National Statistics, Methodology and Statistical Development, www.ons.gov.uk.

(2013), X-13ARIMA-SEATS Reference Manual, Time Series Research Staff, Statistical Research Division, U.S. Bureau of the Census, Washington 2013, https://www.census.gov/srd/www/x13as/.

.

151

(2011), X-12-ARIMA Reference Manual, Time Series Research Staff, Statistical Research Division, U.S. Bureau of the Census, Washington 2007, https://www.census.gov/ts/x12a/v03/x12adocV03.pdf.

152