The average values of the data belonging to the variable past periods to be estimated are created by calculating. As an example, let’s try to create a model with Fertility rate data in Germany.
When we apply the data from the previous years with the above formula:
In this method, the estimated value that the Y variable will receive in the next period is calculated by taking the average of that variable in a certain period into account. We express this period with “n” in the formula.
There is no clear answer to how to get n when using the moving average. However, starting from its general use; By selecting 2 and 7 for n, n can be preferred, which gives the lowest mean estimation error between these periods.
Let’s try to fit this information into our table above:
If the data in the sample is used and n = 4, the fertility rate in 2021 (i = 22) is:
Likewise, if we choose n = 5, the estimated fertility rate for 2021 is:
In this method, the estimated value of the Y variable in period i is calculated by multiplying the actual value of the previous period by ‘α’ and adding it to each other by multiplying the estimated value of the previous period (1-α). A value between 0 and 1 is chosen for ‘α’.
In addition, the 1st-period forecast value (Y ^ 1) is generally taken as the same as the 1st-period realization value. We can see them better in the table. But first, let’s choose a value for α and make an estimate.
We chose it as α = 0.9. Now let’s start with Y ^ 1 one by one and look at our guess for Y ^ 22:
It is a method where X represents time. Therefore it is different from the simple linear regression method. A and b values are calculated with priority. X — the year as the date or whatever — is adapted to the equation Y = a + bX
Above, we replace the values representing each year with X as time. The first part we need to determine in this equation. In that case:
And before we calculate a, b, we tabulate X and Y by adding their sum at the end:
Let’s first look at the general formula of a and b.
Now let’s replace the ‘a + bX’ values we need in the equation for the year Y ^ 2021.
First of all, let’s calculate b because we need to know b in a. For all of them, we will get help from the values we have specified as SUM in our table above.
Now is the time to substitute values for 2021 (i = 22 = X), which is the year we will predict:
Pek cok veride mevsimselligin bir ölcüde etken olabilecegini biliyoruz. Bunun sadece uyarlanmasiyla ilgili eldeki verilerin sadece yilin belli dönemlerini yansitan veri halinde elde edilmesi ön sarttir. Ancak bunu elimizdeki veriye uyarlamak icin böyle bir mevsimsel referans yoktu. Bunun yerine yaz ve sonbaharin ilk aylarinda daha fazla dogum olduguna dair suradaki referans alarak ortalama dogum oranini degistirmeyecek sekilde veri seti olusturduk.
We know that in many data, seasonality can be a factor in some measure. It is a prerequisite that the data available only for the adaptation of this is obtained as data reflecting only certain periods of the year.
However, there was no such seasonal reference to adapt this to the data we have. Instead, we created a data set in a way that would not change the average birth rate by referring to the news here that there were more births in the early months of summer and autumn.
Maybe, we think that the ice cream sales that increase in the summer months will not have a seasonal effect as much as the sales such as coats and gloves in winter. The important thing is to learn how to use seasonality and trend ratio together.
Let’s show this only for the last 4 years before 2021 so that it does not take up too much space.
In this method, data are first adapted to trend analysis, regardless of seasonality. Accordingly, the increasing and the decreasing trend is determined. Then, according to this trend, how much higher or lower seasonal values are calculated as an average. Thanks to the adaptations according to this trend, the next period can be predicted. For each year, 4 values are listed one after the other.
We calculated a and b for trend rates by using the values in the table. According to this:
Finally, when we put the values in the equation:
Y = a + bX = 0,03 + 0,004X
Let’s write down the values of the last 4 years for each season in the table:
Now we can rate trend analysis for every season.
And now we are at the final stage. For 2021, we can calculate birth rates separately for each season.
Yes, if we take a final board and the last situation for 5 different predictions: