1 00:00:00,770 --> 00:00:09,660 A simple and a popular method for removing untrained and a seasonal pattern from a cities is by the 2 00:00:09,660 --> 00:00:11,360 operation of different thing. 3 00:00:13,320 --> 00:00:16,650 Different thing means taking the difference between two values. 4 00:00:18,330 --> 00:00:19,270 So a lag. 5 00:00:19,290 --> 00:00:27,000 One difference, which is also called first difference, means that we are taking difference between 6 00:00:27,180 --> 00:00:30,000 every two consecutive values in the series. 7 00:00:31,840 --> 00:00:39,590 For example, in this snippet of a line mice data, you can see that in this second column we have a 8 00:00:39,590 --> 00:00:43,470 line Miles traveled in the third column. 9 00:00:43,710 --> 00:00:46,650 We have lag one values of these data points. 10 00:00:47,310 --> 00:00:52,140 So the mileage value of January is now present in the second row. 11 00:00:53,580 --> 00:00:56,670 The mileage value of fab is now present in the third row. 12 00:00:57,090 --> 00:01:01,200 So this is basically lag one value of this Miles column. 13 00:01:02,940 --> 00:01:04,320 When we difference these two. 14 00:01:05,310 --> 00:01:10,770 So if you look at the second row, the difference between these two values is minus six. 15 00:01:10,770 --> 00:01:14,130 Forty nine for the third row. 16 00:01:14,240 --> 00:01:15,930 The defense's nine zero six. 17 00:01:16,320 --> 00:01:20,430 So there's different values, creates another series. 18 00:01:21,030 --> 00:01:25,080 And this series is called Lag One, Different Cities. 19 00:01:27,360 --> 00:01:37,410 Similarly, if you want to generalize, we can say that different thing at laggy is subtracting devalue 20 00:01:37,590 --> 00:01:39,120 from gay periods back. 21 00:01:40,620 --> 00:01:42,390 So it is basically whity. 22 00:01:42,540 --> 00:01:49,380 That is pantry's value at twenty minus times, these value at Bain B minus key. 23 00:01:51,390 --> 00:01:55,200 So for example, for our daily series lags seven. 24 00:01:55,200 --> 00:01:59,190 Defensing means subtracting from each value. 25 00:01:59,910 --> 00:02:02,850 The value of same day in the previous week. 26 00:02:05,740 --> 00:02:13,330 This technique of defending is used to remove print and seasonal patterns and obtain cities which like 27 00:02:13,480 --> 00:02:14,500 both of these things. 28 00:02:15,680 --> 00:02:17,140 So let's see how we remove print. 29 00:02:20,470 --> 00:02:25,810 And if we got on the top, you can see that our times this has a clear upward trend. 30 00:02:27,520 --> 00:02:34,600 When we do a flag, one different thing and bloddy lag one difference values these values. 31 00:02:34,690 --> 00:02:37,080 Now do not have any visible print. 32 00:02:38,650 --> 00:02:47,980 And you can also notice that this method of lag when the printing does not assume that the trend is 33 00:02:47,980 --> 00:02:48,430 global. 34 00:02:49,150 --> 00:02:54,290 So even if in the initial part of this series you had a slow upward trend. 35 00:02:54,760 --> 00:02:58,350 And in the later part of the series, the upward trend increases. 36 00:02:59,230 --> 00:03:03,530 Still, your lag when the printing will give you beat rendered cities. 37 00:03:05,140 --> 00:03:12,750 When you do one time different thing, you'll be able to remove linear drinks for quadratic and exploring 38 00:03:12,770 --> 00:03:13,340 children. 39 00:03:15,010 --> 00:03:22,320 We often have another round of lag when the printing, which has to be applied to our different series. 40 00:03:23,650 --> 00:03:29,320 So for a quadratic print, we will take the new series and do different thing again. 41 00:03:30,990 --> 00:03:35,050 Does it is that we will get then will not have the quadratic ring. 42 00:03:36,830 --> 00:03:39,010 Once you have a series which does not have print. 43 00:03:39,760 --> 00:03:47,380 You can use different ink to remove seasonality also for removing a seasonal pattern with M seasons 44 00:03:48,390 --> 00:03:49,690 with different at a lag. 45 00:03:49,900 --> 00:03:59,580 And for example, to remove a monthly pattern in our monthly data, we can take lag where difference. 46 00:04:00,940 --> 00:04:09,670 This means that if your sales undergo a cycle within one year, that is, for example, in the month 47 00:04:09,670 --> 00:04:16,780 of June and July, you have increasing and nearly closing of the year your sales dip in such scenarios. 48 00:04:17,230 --> 00:04:25,750 We can say that there is a yearly cycle and seasonality is monthly to remove this kind of seasonality. 49 00:04:26,470 --> 00:04:28,090 We will do a lag. 50 00:04:28,480 --> 00:04:29,080 Defensing. 51 00:04:29,860 --> 00:04:38,830 So you will different the sales value of July 2020 with the sales value of July 2019. 52 00:04:40,870 --> 00:04:47,680 The resulting series that you will get will be be seasonal least seasonality will be removed from it. 53 00:04:48,460 --> 00:04:56,230 If you have weekly seasonality, that is, if on weekends your sales increase and on weekdays your sales 54 00:04:56,230 --> 00:04:56,770 decrease. 55 00:04:57,580 --> 00:04:58,750 Then we can do a lag. 56 00:04:58,750 --> 00:05:06,550 Seven different thing in which we will subtract the sales of last Sunday from this Sunday. 57 00:05:10,690 --> 00:05:18,820 You can see in this graph also when we apply these seasonality on this left graph, we get this new 58 00:05:18,820 --> 00:05:23,530 graph which is not showing any particular cyclic seasonal effect. 59 00:05:24,310 --> 00:05:27,600 The seasonal pattern is more prominent in the initial part of the series. 60 00:05:28,090 --> 00:05:37,210 And you can see that here the seasonal pattern is now removed in the final cities in case you have bought 61 00:05:37,360 --> 00:05:39,310 trend and seasonality in your data. 62 00:05:39,880 --> 00:05:44,080 You have to do different thing twice, once to remove the trend. 63 00:05:44,620 --> 00:05:53,020 And second, to remove these seasonality in this way from the initial cities where you have both tendencies, 64 00:05:53,020 --> 00:06:01,780 Naledi, and you cannot apply many of our methods which only apply to cities which do not have prevented 65 00:06:01,790 --> 00:06:02,260 naledi. 66 00:06:02,950 --> 00:06:08,110 We apply this method of defensing to get a series which do not have random seasonality. 67 00:06:08,410 --> 00:06:13,540 And then we can apply those models where the cities must be D seasonal later. 68 00:06:13,630 --> 00:06:14,110 Detering.