Slopes of seasonal variations of time series and forecasts: Practical case on weather

This article introduces a model to develop seasonal time series forecasts based on the stability of the seasonal slopes ofvariation of the successive values of the series in matter at the two successive times. The proposed method is based on the average of the slopes of two successive instants of the same seasons during the periods of this series. The power of this method is derived from the concept of deriving the graph of the time series as an indicator of the direction of its variation. Thus, this model relies on stabilized slopes as steps of variation from an instant to the next. This method developed here is implemented to predict the temperature of the city Basel-Switzerland to show the effectiveness of this model that adopts the derivative of order 1 the series between two successive instants. Taking into account that we have not taken into account all the factors influencing the weather, including the temperature. So, the results obtained will not be accurate enough as possible. in fact, the average difference between the calculated and observed values of temperature was 4.37°C.


Introduction
In various fields these days, huge amounts of time series are generated/collected by sensors allocated for this purpose. In this regard, many studies have taken a special place in the context of forecasting. As early as the 1930s, prediction models appeared in the application of the first univariate models to data. Concerning uni-varied models, they are to make forecasts based on models that allow to adapt the data of a time series to an adequate model. For example, the Auto-Regressive (AR) and Auto-Regressive Integrated Moving Average (ARIMA) models [1,2]. In addition, multivariate prediction models depend on previous values of itself and other variables, for example we find the model "Vector Auto-Regressive (VAR)", "Vector Error Correction (VEC)" [3,4].
In most cases, these modules adopting recursive algorithms based on auxiliary models, a stochastic gradient algorithm and a recursive least squares algorithm, are developed for multivariable Box-Jenkins's systems [1,5].These types of models are widely used, alone or in combination with others, such as the vector autoregressive neural network model [3,6,7,8]. In generalizations of ARCH (Autoregressive Conditional Heteroskedastic) processes are also available, with the aim of taking into account conditional variances [9]. Most forecasting models adopt the derivatives of the time series in order to verify its stationarity.
In the present study, we will adopt the first derivate and the coordinates of the starting value to forecast the next value of the series in question. Thus, this work will focus on studying forecasts for uni-varied seasonal time series (y_i )_(1≤i≤n) of nearly stable seasonal variation slopes. This study will be carried out through the seasonal coefficients of the slopes of two successive values y_iand y_(i+1), with the aim of making forecasts based on the stability of the slopes of seasonal variations.

Methods
The model developed is built on the seasonal slopes stabilized through the history of the time series studied instant by instant with respect the condition that the seasonal slopes are almost stable. For these reasons, I have taken as an example of application the temperature of June for ten years from 2010 to 2020, i.e. each instant is repeated 10 times in the various seasons of this series. On the one hand, to stabilize the slopes from one hour to another. On the other hand, because June is one of the most stable months of the year. Thus, with this model, the forecasting study during this month will be more credible. This model is based on only one temperature factor while other factors influence the temperature. This will not give us a sufficiently accurate forecast. Moreover, this model does not take into account all the factors influencing the temperature and therefore the calculated forecasts will not be accurate enough. The temperature time series taken as an example is supposed to be the most suitable to apply this elaborate model because at least it is continuous and derivable.

Results and Discussion
Let ( )be a seasonal time series of × instants ( ℎ ; ∈ ℕ) which we note ( ) such that the value is the ℎ value of the ℎ period (see Table 1.), with 1 ≤ ≤ and 1 ≤ ≤ .In other words, the value is the [( − 1) + ] ℎ value of this series.
The values of the series ( ) are well classified in the table 1. below: Table 1. Classification of the values of the time series by period and season

Seasonal coefficients of the slopes of successive values
Generally speaking, if a time series is of the form ( ), then if we based on the notion of derivative of order 1 we define the slope coefficient of this series variation between two successive values, from the instant to the instant + 1, of the form: Let us now consider ( ) the form already defined for a seasonal time series. In the ℎ period, the slope between the two successive values and ( +1) is of the form: Taking into consideration the passage from a period to the next: the last value of the ℎ period will be the first of the ( + 1) ℎ period.

Average coefficients of seasonal slopes
Under the constraints of time series whose seasonal slopes are almost parallel, almost equal. in other words, the seasonality and position of the values influence the subsequent values almost identically. Then, it is credible to take the average (see formula 3) of the coefficients of the season slopes as the corrected and approximated slope of all the slopes of that season. Thus, for each season , we obtain: Thus, in the following table (table 2.) the slopes of the successive values of each period according to the periods and the seasons: Table 2. Seasonal slopes of successive values for each period Average coefficients of seasonal slopes

Estimation of the corrected values of the time series
For each period , the estimate of ( +1) from will be of the form: Under the assumption that the time series keeps almost the same slopes in the long run, we can estimate the future values of this long run series from a real initial value in the following recurrent way: Taking into account that the slopes are steps of seasonal variation and which generate the corrected values and also the future values.

Estimates of the average error of the corrected values
In a period , the precision error of this model for each season j is the difference between the observed value and the calculated value: Subsequently, the model's accuracy error for each season will be expressed, as the square root of the average of the squares of the differences between the calculated values and the observed values during all periods , in the following form:  (6) and (7)), will be expressed and arranged according to each season in the following table: Table 3. Seasonal errors ℰ between the adjusted values and the observed values Thus, the average error of the entire estimate of this model is: This allows us to see which are the most disturbed and which are the most stable seasons of the series.

Application on the weather forecast for the city of Basel-Switzerland in terms of temperature
The historical weather data for the city of Basel-Switzerland on which I worked were downloaded from the « meteoblue 1 »website, see (Weather Basel, 2021) [10] and in particular the link below. On this weather data, I will apply the forecast model developed above based on the assumption of stable hour-to-hour temperature variation slopes of June months from 2010 to 2020. After applying the above model, I got the temperature forecast (Table 4.) for the city of Basel for the month of June 2021, as follows: