In this lecture, we are going to learn about how to create a remote model in Python and how to select
B, B and Q values for A more modern.
So for this problem, we are going to use shampoo, not CSB dataset.
You can download this dataset from the resources section of this video.
So let's import this and let's take the first five videos of ordinator say.
So we have month column and we have sales column and we want to create our model on the sales column
of this data.
Now, let's.
Glad to see sales data.
You can see this is the sales data.
We have data offered on prettify records.
Now, here, if you look at it, you can see that there is no seasonality at such and there is some
sort of quarterdeck crane.
At first the increase is very slow.
But as we go on, the the increase is increasing with the time.
So this is some sort of order decreeing that we are seeing in the sales data.
And therefore, since this is according to Crane, we need to defensing.
To make it stationary.
That's why our B should be Q so in Atima, we have three parameters, B, B and Q B sense for a number
of items.
We want to consider for authorization, B sense for a number of defensing and Q sense for a number of
items we want to consider for moving average part.
Since our data has quadratic Krang, we will be using Bique what to do in case of linear trend.
We should use the equal to one.
Now let's look at how to select B and Q parameters.
So to select you, you should Blondeau Autocorrelation Klodt.
We have already discussed this graph and times it is with Malaysian Park.
So we are just going to take.
This is the auto relation part for the sales data that we have.
We have the correlation well-used with the lag very well.
So this is the correlation value with leg one.
This is the correlation value with leg two and so on.
We have this data for around today, five leg values.
We have confidence interval mount as a strict length.
In this graph, you should look at the value of weight.
The line is crossing the confidence interval.
So if you can see the line is crossing confidence interval line around here.
So the value just before this point is five.
So we should consider five as the value for you.
So for any time, cities, if you want to run a remote more than first, block the line, check and
identify the train.
Then not autocorrelation lord.
And look at where the autocorrelation plot is crossing the confidence interval line.
And then also flawed, the partial autocorrelation draft to find out.
Be here, the line is crossing after black file.
That's why we should select you to fight.
No, let's applaud autocorrelation Lord.
Autocorrelation Lord is available in a sex model.
So first let's imported and then Lord take again.
These are the autocorrelation values with the leg variable.
We have considered for thin legs for this graph.
And we're loading the parcel.
Although coordination dropped on the sales data, the blue band here is again the confidence interval.
Now you can see that this partial autocorrelation is crossing the confidence interval.
Add value three two.
Therefore, we should consider two as be for our remodel.
The first barrier is it's for the very well itself.
So that's why we are getting partial out of religion value of one.
This is for legman.
This is for like two.
And this is phylactery.
The graph is crossing confidence interval between two and three.
That's why we should consider two.
Now, since we have the value of B, Q and B, we should train over at a memorial on these parameters.
So first we are importing an e-mail from sex model.
So it's imported.
Then on the other steps are almost similar.
We first define our model object.
Our model is a rhema on sales data.
And we have to give believe to values using this parameter.
So we are using order equal to.
And then we can pass a double first.
We have to give B, then B, then Q.
That's why we are passing a couple of come to my life.
Let's run this.
Now let's fit our model than.
So the effort and the model ignored ignore this morning, saw this.
Messages.
Now to look at all local fishing and their values.
You can use modern fact dot somebody's mental.
So if you run this, you will get all the information that you need.
So here we have the modern name.
The number of observations.
And then here you can see the consent value.
The variables that we are considering.
So we are considering five leg variables for auto regression.
That's why we have five variables named as one and two and three and four and five with prefix as air.
Other stand for auto regulation.
Then our cue is to that is we are considering two variables for moving average.
That's why we have two wearables, L1, L2 with refix Emma Emma sense for moving average.
You can also see the coefficient values for all these variables.
You can also see the P values for these variables.
The smaller the Bulu, the more important that variable is.
So the most important variable in our model is L1 and a little four auto regulation and L2 for moving
average.
So using the P value, you can also define importance of variables.
Now, we will also look at the resolution where news of more than you can get that has real value from
door dressing.
My take.
So I'm just equating Rassa realistic way to model fake thought.
President elect Flodden, this desolate.
Now, we have discussed that the red civil should be in the form of white noise.
There should be no visible pattern in your resolution if there is any pattern in your resolution.
That means that you can improve your model and there is some information in your model that you are
missing.
So you can see that there is no trend or seasonality that is going on in our lives.
Well, and this is acting like a white noise.
We can also look at the mean value of the restaurant.
You can see that the mean value of resolution is eleven and the minimum, 25, 50 percent and 75 percentile.
And Maxwell, you are following the bell curve.
So the sort of a 10 restaurant statistics are looking good.
And you should also look at the restaurant value after running at him more than.
Now, these are some of the video agents offering my more than.
We just feels this one, Atima, where we're defined to be and be.
Now, if you want to run auto regression, you can use a rhema where the variables for Amet is zero.
And if you want to just use moving average, you can define number of auto technician terms to be use
and model as zero.
So if you just give P and the values and Q is zero, then you are running auto regression model.
And if you're PS zero and you are giving one lady and Q A loose, then you are running.
And my model.
So there is no need of finding out the rest of the year and running auto regression on that to execute
moving average more than you can just use a remote model as well.
Do random moving average model.
So an animal model.
All three models are covered.
You can always use a remote more than with BD and you will use.
You can use auto regression with you equate to zero and you can also use moving average with be quick
Lozito.
Now, he might have to mentor spoof forecast of future Trelew.
First is the forecast method.
If you just rate model for DORT forecasts, it will automatically give you the forecast for next Piter.
So water and in the forecast, you can see.
Does an array of three different durry?
First, you have the forecasted value.
Then you have the standard deviation.
And then you have the 95 percent confidence interval for that value.
So if you just want to select the forecasted value, you can write.
Since you won the first.
And this one because in the first set, you wanted this value.
So if you run this, you will get the forecasted value, which is equal to this value.
So 636 is the forecast set value for the next bidder.
If you want to get these values for my people, put it.
So suppose if I want to get values for next five period, I can just straight forecast and I can provide
an integer value for the time bidders.
I want the forecast for.
So if I had a straight model under Sawford, Dorte forecast an argument is five.
I will get the value for next five time periods.
So in the first array we have the forecasted value in the second that a.
B.
The standard deviation.
And in the last study I have the confidence interval for those forecasted values.
Again, if I just want any particular value, I can use a square bracket to select that particular value.
You can also use these values to plot the graph.
So I just read this.
I will get the first today and then I can plot this day on a later.
So that's all for Atima in the next lecture.
We will look at how to use walk forward validation for animal models.