In this lecture, we will learn how to include seasonality.
No, Eddie, my model.
Or how do you study my model in Python?
Satima essense for seasonal Atima.
And this model also incorporate seasonality while fitting or training or model.
Now, one of the limitation of Eyadema is that it can only handle Ukraine in your data.
If your data have seasonality, you first served to the IT and then use that in my model on their DePrince
data.
To overcome this limitation, we have Satima model where we include both grand and seasonality while
modeling.
So in Rhema you just have to provide beebee you variables.
What in Satima you have to provide seven different parameters.
First you have to broyd lowercase beebee Q for data and then a better case.
BBC you and M for the seasonal data lowercase B essense for a number of domes.
We want to consider for auto regression be censored number of times.
We want to do depressing cuz sense for number of lag times.
We want to consider for moving average.
Now all these mortgages we need you is four grand that we haven't discussed in a remodel so.
No, next, we have four other parameters, capital p sense for seasonal auto regressive order.
So this is the number of times you want to consider for auto regression, for seasonality.
So if you are giving capital P equal to one, this means that the model will also consider one seasonality
lag.
So if you're seasonality is of value time period or you have a yearly seasonality, it will consider
the last year value for auto regression.
Similarly, B is the number of defensing you want to be seasonal as your data.
Q Is the number of seasonal times you want to include in your moving average and M is the number of
times steps for a single seasonal period.
So if you have a monthly data and and yearly seasonality, you have to give AM equates to an.
If you have a daily data and you have a weekly seasonality, you have to give Amik way to seven.
The implementation is almost similar to Eyadema.
So instead of Eyadema, this time you have to import Satima X from his set Smardon and we will be using
U.S. airline monthly aircraft data.
Since this data have both grindin seasonality on.
Let's look at the head of this data.
The first column we have is for one.
The second volume V is for the minus.
Let's look at the less.
Well.
So we have data for on 17 years from 1963 to 1970.
Let's change the index as well so that we can decompose this data to look at the trend and seasonality,
we'll be using the seasonally decompose function from insects for the library.
This will decompose our data frame and pull forward parts.
First one is the observe data.
You can see that on the raw data itself.
You can see some kind seasonality.
Then we have the trend line tech, which is showing us how the trend is changing with time.
You can see that we can say that this is a linear crane and we only need one defensing to decode our
data.
Then we have the seasonality graph.
You can see that the seasonality varies from point eight to one point two.
That's mean if we are using multiplicative model, there is a change of 20 percent due to seasonality.
And that's huge.
So we can say that our data have high seasonality.
And the next thing you can notice is that the seasonality is a little seasonality.
So this is 1964.
This is 1963.
This is 1965.
But you can see that the cycle is repeating year after year.
And then we have that as a real graph for our data.
So from this graph, we can say that our lower case, D. That is the defensing we need to be trained.
The data should be one and M should be well, since we have a monthly data and then yearly seasonality.
So this is the parameters we are going to use.
So, no, this is the parameters that we are going to use while creating the model object.
We have to give two parameter.
First one is the order.
And the second one is the seasonal order.
Order is the same as what we give them a rhema.
That is lowercase B, B and Cuba loose.
And seasonal order is the additional parameter that we have to give in Satima where we have to give
capital.
B, capital.
Q Aleuts.
And then the M value.
So we are willing to train set.
He makes more than on minus data with B as five, B as one and lowercase Q as three.
Whereas A part is B, B, Q and M as one comma, one comma, one comma 20 respectively.
So let's create this model object and let's for this data we have over our data.
We can also check out the rest rules of this model so that we can say that modulo extricated all the
information that they they in the data.
So let's plot.
That's real.
You can see that the restaurants are centred around zero and that is no Grendon seasonality in the resolution.
This that bulls are like a white noise.
And we can say that.
I would more than ever extracted all the information from this dataset.
No.
Here also, just like Remar, we can use Daudt forecast.
My turn to get forecasts value of the next budget.
So let's clear the variable output.
And we are saving the forecast value of the next puttered.
And that's all very well.
Let's look at those.
Well, you can see that we are getting there.
So if you see, here's the deal.
We have data in 1970, December.
And now we are getting the forecast for January 1971.
And the forecast value is eleven thousand four hundred and seventy five.
You can also pass parameters and this forecast matter.
So if I just write well, it will give me the forecasts of 30 days.
You can see we have the forecast for next from this.
Now, just like Remar, we have Dort Kraddick function as well and don't predict Fanshen.
We have to provide a start date and end date.
And if we don't broyd any date, it will give prediction values for all the values that are available
in your data.
So I am sorting this information in my head very well.
So now we have predicted values from this model, from e're 1963 to e're 1970.
And this variable Y ahead.
And we have the predicted value for next year.
And this variable that is more than underscore for Dort forecast.
So if you just look at why had.
You can see that we have the forecast said value for first five records here using a lot more than that.
Now, we can also plot this forecast set value against the actual values.
So we are winning put Lord D.F. Mind, Simon, and we are plotting way ahead on the same plot using
that killer.
So let's look at the plot.
Well, you can see this blue line are the oldest known values.
And this red line is the predicted value using the word model.
The blue line and the red line almost mowing.
And then.
And that is not much variation in two values.
So that Sölvi Element, Satima and Biton.
And we predict values using ceremony more.
We can also use walk forward validation in Satima.
We already have executed walk forward validation for each other.
And remember that you can use the same code for setting my model as well.
Just do some necessary changes in the model creation.
So that's all for this lecture.
Thank you.