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
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.
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;
—strength of trend;
—seasonal strength;
—additive decomposition model strength;
—multiplicative decomposition model strength;
—strength calculated on end of period data;
—strength calculated on arithmetic mean data;
—strength calculated on 1st and 3rd quartile arithmetic mean data.
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 ≈ 0.974.
Seasonal strength is approximately the same in all data sets. The best seasonal strength average results is for ≈ 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 ≈ 0.971.
Seasonal strength is approximately the same in all data sets. The best seasonal strength average results are for ≈ 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.