Next Article in Journal
Asymptotic Distributions of M-Estimates for Parameters of Multivariate Time Series with Strong Mixing Property
Previous Article in Journal
Comparative Analysis of Statistical and Analytical Techniques for the Study of GNSS Geodetic Time Series
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Proceeding Paper

Business Days Time Series Weekly Trend and Seasonality †

Department of Computer Sciences, University of Latvia, LV-1586 Riga, Latvia
Presented at the 7th International conference on Time Series and Forecasting, Gran Canaria, Spain, 19–21 July 2021.
Published: 28 June 2021
(This article belongs to the Proceedings of The 7th International Conference on Time Series and Forecasting)

Abstract

:
The world changes at incredible speed. Global warming and enormous money printing are two examples, which do not affect every one of us equally. “Where and when to spend the vacation?”; “In what currency to store the money?” are just a few questions that might get asked more frequently. Knowledge gained from freely available temperature data and currency exchange rates can provide better advice. Classical time series decomposition discovers trend and seasonality patterns in data. I propose to visualize trend and seasonality data in one chart. Furthermore, I developed a calendar adjustment method to obtain weekly trend and seasonality data and display them in the chart.

1. Introduction

Economic digital transformation, and Green Call are current European Commission programs that have a billion-euro budget. There are still sites, where there are published raw data and either no or weak or paid statistics.
One example is meteorological weather data. Latvia pays for data gathering at meteo stations all over the country, but statistics are for money. While tourism has been suffering big losses recently, that could be improved so that people are more informed about local weather conditions.
Another example is currency exchange rates. European Central Bank publishes raw data and their charts (https://www.ecb.europa.eu/stats/policy_and_exchange_rates, accessed on 25 June 2021), but there is no information regarding trends and seasonality patterns. Furthermore, in the charts, weekly data frequency is missing. The UK’s favorite currency site has more charts, statistics, and trend information (https://www.exchangerates.org.uk, accessed on 25 June 2021), but there is also missing calculated trend and seasonality patterns and weekly data charts. Figure 1 shows data visualization examples from ECB and UK currency exchange sites.
Trend and seasonality pattern discovery and their visualization is described and summarized in the free online book “Forecasting: Principles and Practice” written by Hyndman and Athanasopoulos [1]. With many solutions for everyday forecasting needs, in chapter 12 there are also mentioned issues that are challenging to tackle. One of them is weekly data processing. I also tried to find satisfactory weekly data analysis on the Internet, but unsuccessfully. To deal with this issue, I thought of the weekly data calendar adjustment method and seasonal plot enrichment with seasonality calculations. This paper reports on my progress so far and provides some calculations of the proposed method.
In this paper, I take formulas from the book’s chapter 6, on time series decomposition. Meteorological data are from the Latvia meteo site for the city Liepaja (https://www.meteo.lv/meteorologija-datu-meklesana, accessed on 25 June 2021). Currency exchange rates are from the ECB site. ECB publishes current rates for 32 currency pairs.

2. Proposal

Data in seasonal plots provide a lot of information in a small space. Time series highs and lows in different periods of time, when expressed using blocks of plain text or tables, are lengthy and overwhelming. Time series decomposition in trend and seasonal components provide additional quantitative characteristics, which are usually plotted in separate graphics. I suggest adding a seasonality component to seasonal plot.
Time series decomposition can be applied to monthly data. I propose also incorporating the decomposition into more frequent time periods. Therefore, I introduce the time period keews, which are similar to weeks, but with better calendar characteristics. It is much easier to perform the calculations if a year, instead of average number of weeks 52.18, has exactly 48 keews, and each month is 4 keews.
Seasonal plot with seasonal component is described in Section 2.1, calendar adjustment with keew in Section 2.2, more complex case for currency exchange rates in Section 2.3.

2.1. Temperature Seasonal Plot

Time series decomposition equation is y t = S t + T t + R t , where y t is the data, S t is the seasonal component, T t is the trend-cycle component, and R t is the remainder component, all at period t. Python library Statsmodels has freely available formula implementation (https://www.statsmodels.org/stable/generated/statsmodels.tsa.seasonal.seasonal_decompose.html, accessed on 25 June 2021).
Liepaja is a city in western Latvia, located on the Baltic Sea. It is a popular summer vacation destination due to sandy beaches and music festivals. Figure 2 shows an example of Liepaja monthly temperature seasonal plot with added seasonality estimation. The monthly data consists of the average actual temperature in Liepaja at 12 o’clock each day. The seasonal plot includes last 5 years of data so as not to become too overwhelming. The figure shows that the hottest month is August and trend of the last three years is a temperature increase by approximately a degree.
The used time series decomposition model is a naive approach from 1920s and more sophisticated models are proposed. In this paper, I focus on decomposition possibilities in general, but in each case should be considered usage of more specific decomposition models [2,3,4], etc.

2.2. Calendar Adjustment with Keew

Current Python decomposition formula implementation has no clear way of doing calculations for weeks. There is parameter period that can be provided, but in a year, the average number of weeks is 52.18. I propose to introduce a concept of time period—keews. In this case, a year will have exactly 48 keews, and each month—4 keews.
Four keews will be in one month boundaries and they will end on the following month days:
  • The 4th keew will end on the month’s last day;
  • The 2nd keew will end in the middle of month on day 15;
  • The 3rd keew will end on the following days:
    (a)
    For months with 31 days, it will be day 23, so that 4th keew and 3rd keew will be equally 8 days long;
    (b)
    For months with 30 days, it will also be day 23, so that all months but February will have the same 3rd keew end day;
    (c)
    For February, the 3rd keew will end on day 22.
  • The 1st keew will end on day 7 with no additional consideration.
Table 1 gives a summary of keews.
Keews consist of all days in their month–day range.
Figure 3 shows an example of corresponding Liepaja keew temperature seasonal plot with seasonality estimation. This is more precise picture for summer tempretures in Liepaja. It shows that the hottest keew is at the end of July and that summers in Liepaja can also have colder keews in June. This should be taken in consideration when planning vacations.

2.3. Exchange Rate Seasonal Plot with Seasonality Estimation

More complex data is currency exchange rates. Exchange rates by ECB are given on business days. Exchange rates can have different strong trends during a year. I propose to also display these data with keew seasonal plot together with seasonality estimation.
Due to the fact that data are only for business days, keews will have less meaningful days. For the last 5 years, there are keews with 3 business days in 1% cases, 4 business days in 8% cases, 5 business days in 48% cases and 6 business days in 43% cases. The good thing is that the majority of keews have 5 and 6 business days.
Figure 4 shows exchange rates for EUR/USD currency pair in a keew seasonal plot with seasonality estimation. In this case, seasonality is calculated with Python decomposition multiplicative model, seasonal mean is the arithmetic mean of the 1st keews of years. To add the seasonal component to seasonal plot, it should be expressed in seasonal plot scale; therefore, in the figure, the seasonality line is given by multiplying the seasonality component with the seasonal mean. Year trend lines show exchange rates on the last business day in the keew.
In general, the keews end dates are suitable for keeping in one month boundaries. It is then easier to compare the displayed results with month estimations. However, different keews end dates can be chosen to better suit further prediction needs. Furthermore, some research on Forex calendar effects show that not all business days are equal one to other [5,6,7,8].

3. Results

Firstly, the purpose of the statistics calculation is to ascertain that keew trend and seasonality characteristics are similar to monthly estimations. Secondly, it is to find the best seasonality estimations to include in the seasonal plot.
I pick the best model by testing different types of models and data forms. Calculations are based on classical decomposition. It has two forms: an additive decomposition and a multiplicative decomposition. As the purpose is to find and use only seasonal components, then data in models also can be in different forms. I choose to test the usual end of the period data, and also period arithmetic mean and 1st and 3rd quartile arithmetic mean.
Trend and seasonality strength can be measured as described in Hyndman and Athanasopoulos, 2018 Chapter 6.7 [1].
The results are labeled in the following way:
  • F—strength of decomposition component;
  • F T —strength of trend;
  • F S —seasonal strength;
  • F A —additive decomposition model strength;
  • F M —multiplicative decomposition model strength;
  • F E —strength calculated on end of period data;
  • F N —strength calculated on arithmetic mean data;
  • F D —strength calculated on 1st and 3rd quartile arithmetic mean data.
F S M E means Seasonal component strength calculated with multiplicative decomposition model on end-of-period data.
A keew seasonal plot is a suitable way of presenting data for 5 years, so all time series is analysed starting from year 2015. One ECB currency pair exchange rates does not have data for the whole period; therefore, it is omitted. Another one seasonal component data values are all equal to 0, so it is omitted too.

3.1. Monthly Trend and Seasonality

The strength of the trend is bigger than seasonal strength in all data sets.
The strength of trend differs most between additive and multiplicative decompositions. Multiplicative decomposition models has average strength ≈0.97, while additive average is ≈0.81. The best strength of trend average results is for F T M N ≈ 0.974.
Seasonal strength is approximately the same in all data sets. The best seasonal strength average results is for F S M N ≈ 0.26.

3.2. Business Weekly Trend and Seasonality

The results of business weekly data analysis are similar to monthly data analysis. The strength of the trend is bigger than seasonal strength in all data sets.
The strength of the trend differs most between additive and multiplicative decompositions. Multiplicative decomposition models have an average strength of ≈0.971, while the additive average is ≈0.806. The best strength of trend average results are for F T M N ≈ 0.971.
Seasonal strength is approximately the same in all data sets. The best seasonal strength average results are for F S M D ≈ 0.266.
For example, data sets the best seasonal estimation to add in keew seasonal plot is from multiplicative decomposition calculated on 1st and 3rd quartile arithmetic mean data. As the difference between models seasonal estimations are not considerable, all of them can be used in data plotting.

4. Conclusions

Keew seasonal plot with added seasonality estimation provides more detailed view on data, while maintaining at least several characteristics of monthly estimations. Predictions can be based on five year history observations plotted in one chart. In the coming months, I will also work on proposing calendar adjustments for businesses’ daily trends and seasonality, and I will search for the best chart to display them.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Meteorological data are from the Latvia meteo site for the city Liepaja (https://www.meteo.lv/meteorologija-datu-meklesana, accessed on 25 June 2021). Currency exchange rates are from the ECB site (https://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exchange_rates/html/index.en.html, accessed on 25 June 2021).

References

  1. Hyndman, R.J.; Athanasopoulos, G. Forecasting: Principles and Practice, 2nd ed.; OTexts: Melbourne, Australia, 2018; Available online: OTexts.com/fpp2 (accessed on 5 March 2020).
  2. Quan, J.; Zhan, W.; Chen, Y.; Wang, M.; Wang, J. Time series decomposition of remotely sensed land surface temperature and investigation of trends and seasonal variations in surface urban heat islands. J. Geophys. Res. Atmos. 2016, 121, 2638–2657. [Google Scholar] [CrossRef]
  3. Clevel, R.B.; Clevel, W.S.; McRae, J.E.; Terpenning, I. STL: A seasonal-trend decomposition. J. Off. Stat. 1990, 6, 3–73. [Google Scholar]
  4. Chen, D.; Zhang, J.; Jiang, S. Forecasting the Short-Term Metro Ridership with Seasonal and Trend Decomposition Using Loess and LSTM Neural Networks. IEEE Access 2020, 8, 91181–91187. [Google Scholar] [CrossRef]
  5. Ito, T.; Yamada, M. Puzzles in the Forex Tokyo “Fixing”: Order Imbalances and Biased Pricing by Banks (No. w22820); National Bureau of Economic Research: Cambridge, MA, USA, 2016. [Google Scholar]
  6. Ben-David, I.; Birru, J.; Prokopenya, V. Uninformative feedback and risk taking: Evidence from retail forex trading. Rev. Financ. 2018, 22, 2009–2036. [Google Scholar] [CrossRef]
  7. Popović, S.; Durović, A. Intraweek and intraday trade anomalies: Evidence from FOREX market. Appl. Econ. 2014, 46, 3968–3979. [Google Scholar] [CrossRef]
  8. Dailydytė, I.; Bužienė, I. Black friday and other effects-are they still sustainable in financial markets? J. Secur. Sustain. Issues 2020, 9, 4. [Google Scholar]
Figure 1. Examples from currencies exchange rates sites. (a) ECB exchange rates. (b) UK’s site trend statistics.
Figure 1. Examples from currencies exchange rates sites. (a) ECB exchange rates. (b) UK’s site trend statistics.
Engproc 05 00026 g001
Figure 2. Liepaja monthly temperature seasonal plot.
Figure 2. Liepaja monthly temperature seasonal plot.
Engproc 05 00026 g002
Figure 3. Liepaja keew temperature seasonal plot.
Figure 3. Liepaja keew temperature seasonal plot.
Engproc 05 00026 g003
Figure 4. Exchange rate keew seasonal plot.
Figure 4. Exchange rate keew seasonal plot.
Engproc 05 00026 g004
Table 1. Keews.
Table 1. Keews.
Keew 1Keew 2Keew 3Keew 4
Day 1–Day 7Day 8–Day 15Day 16–Day 23
February 22
Day 24–End of Month
February 23
7 days8 days7, 8 days6, 7, 8 days
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Gutans, K. Business Days Time Series Weekly Trend and Seasonality. Eng. Proc. 2021, 5, 26. https://0-doi-org.brum.beds.ac.uk/10.3390/engproc2021005026

AMA Style

Gutans K. Business Days Time Series Weekly Trend and Seasonality. Engineering Proceedings. 2021; 5(1):26. https://0-doi-org.brum.beds.ac.uk/10.3390/engproc2021005026

Chicago/Turabian Style

Gutans, Karlis. 2021. "Business Days Time Series Weekly Trend and Seasonality" Engineering Proceedings 5, no. 1: 26. https://0-doi-org.brum.beds.ac.uk/10.3390/engproc2021005026

Article Metrics

Back to TopTop