[00:00:00] Thank you. [00:05:30] Good morning, everyone. [00:05:34] Hello, please confirm if you can see my screen and you are able to hear me so that we can [00:05:41] start the session, please write in the chat box. [00:05:48] Hello, good morning, please confirm if I am audible. [00:05:55] Please confirm if I am audible and also if my screen is visible. [00:06:04] And also if my screen is visible. [00:06:13] Okay, thanks for confirming. [00:06:20] Okay, thanks for confirming. [00:06:22] Okay, so we can start. [00:06:31] So we can start. [00:06:32] So today we will talk about the time series. [00:07:02] So we will talk about the time series. [00:07:03] So we will talk about the time series. [00:07:11] So we will talk about the time series. [00:07:12] So we will talk about the time series. [00:07:13] So we will talk about the time series. [00:07:19] So we will talk about the time series data. [00:07:21] and what is time series data right so what is time series so as the name comes time [00:07:29] series so it is a series of data which is collected over time of the same event so [00:07:38] it is collected sequentially over time for example uh the number of kilometers you are going to walk [00:07:45] in uh every day so you collect this data day by day monday tuesday wednesday thursday friday [00:07:55] right so this will create a time series of your daily kilometers similarly if you have your sleep [00:08:05] data so every time your sleep quality is measured as a say suppose our score is given 80 90 70 [00:08:13] percent or number of hours so that is collected every day every night so you can also say it is [00:08:20] a time series data right so the most important thing which makes the crime series different from [00:08:31] uh yeah good morning everyone yeah so the most important thing uh to understand about time [00:08:39] series and the thing which it makes it different from all other uh data is it possesses certain trends [00:08:49] certain seasonality certain variations and some noise so for example uh if i talk about the trend [00:08:57] so suppose the amount number of kilometers which every day you are walking is being increased every day [00:09:04] in a week and then it decreased suddenly on sunday then again it increased till uh sun uh till uh saturday [00:09:17] and on sunday you are on rest so you have not walked much so you can see the data which you are having [00:09:24] it is going to increase uh i mean uh the value of your kilometers which you are going to walk is going [00:09:31] to increase and then suddenly reduces so this says there is an increasing trend till someday okay now uh so [00:09:41] a time series data may have a combination of trend so a trend can be upward or downward also then it [00:09:48] has a combination of a seasonality like all of you works right so if you work in the weekdays [00:09:57] so the number of work a number of hours you walk in weekdays is lesser than number of uh kilometers which [00:10:08] you walk on maybe on weekends so you will see uh seasonality like monday to friday will have a same [00:10:17] behavior and on saturday sunday you will see there is an increase or you may also see like if you are [00:10:24] going work from home on uh two days a week that is monday and uh tuesday rest all you are going to work [00:10:31] from the office so in that case also your data pattern will be different so you can see [00:10:37] apart from uh the regular data which we see in the machine learning time series has certain [00:10:43] classifications certain patterns which are termed as trend seasonality and there are also cyclical [00:10:51] variations like long-term variation of a stock market we cannot say in the stock market that every [00:10:58] uh year the same pattern repeats but it may happen after three four years you will get a [00:11:04] pattern and again the occurrence of that pattern is not fixed right uh but for example if you consider [00:11:13] a temperature or temperature throughout the year may follow a same similar trend for example [00:11:19] the uh temperature which you see in the month of april every year it follows the same trend [00:11:26] like uh more or less 42 degree plus minus two or so but if you see the same thing in october it will [00:11:33] be like a 30 degree plus minus two three degree celsius so you will see it is a seasonal seasonal means [00:11:40] every year it is reoccurring at the same time with some variations so that is the seasonality so that's why [00:11:47] uh that's why you need to consider all those things and that's why the time series data [00:11:53] becomes important the last part is noise or irregularity when you have all the things mixed [00:11:58] together they will add to a noise or irregularity for example someday you fall sick and you have not [00:12:06] walked at all right someday due to some decision from the shock market stock market crashed so that will [00:12:14] become a noise and irregularity so you need to model that also as well in your time series so we will [00:12:20] see all these things how we can do so just to uh make sure so you may see my pointer in the screen and [00:12:29] at times i will be using a marker also so that will be if you if you are uh uh you just make it more [00:12:41] interactive and to make it more uh concepts more uh clear so overall we will see about uh what makes time [00:12:51] series data different how we understand there are stationary there are different uh trends seasonality [00:13:00] cycles noise and dependence over time and we'll build one of this model we'll not build all but we'll [00:13:07] build one of the model to see how it works am i not audible ganesh [00:13:15] not able to hear me if anyone else who can hear me [00:13:26] right right so uh ganesh please just check your audio connection if you can uh if it helps some [00:13:33] settings may be uh there which may not be able [00:13:37] okay so in this case in the case when uh there is a some uh uh issues in my audio on in my screen so [00:13:49] please point me although i will try to be audible loud and clear okay so yeah thank you very much for [00:13:58] the confirmation right so uh coming back to our discussion so you will see a component of a time [00:14:06] series it will have a trend it can have a seasonality it can have a cyclicality cyclicality which is not [00:14:16] seasonal but still you will see the patterns are being repeated but you are not sure about [00:14:22] or after what interval irregular means it is having a noise you cannot model it clearly [00:14:29] right so the time series best is best in modeling trend seasonality and cyclicality okay so going [00:14:41] forward so this figures are trend is like this is an increasing trend it can be a decreasing trend also [00:14:48] it can be a straight line also uh so you can say it can be a modeled as a linear or it can be a little [00:14:55] exponential also but it can be modeled seasonality is like you can see this peak pattern is repeating [00:15:01] after some set of interval if this is the time lines cyclicality you see that this is intervening [00:15:11] repeating but not in equal interval of time and irregular means it contains some shocks it contains [00:15:18] some noise which needs to be modeled okay so just to give you example this is an upward trend but [00:15:24] it is a non-linear the blue one is a linear trend which can be modeled but it is an upward trend as [00:15:31] you see the uh values are going to increase and this is right so uh so this uh what is data everybody of [00:15:43] you must be aware but let's see from the point of view of time series so if you collect any data [00:15:49] data which is nothing but it is an observation of some uh event at a particular time or [00:15:59] uh phenomena you can say so a time series data is the observed value of the same variable or same event [00:16:09] which is collected over time for example you take a daily temperature for one city but a cross-sectional [00:16:16] data is like if you take a mass of 100 students at the same time roughly at the same time the mass [00:16:22] they get in the examination so it becomes a cross-sectional data which you cannot model over the [00:16:27] time so you cannot say it is a time model so first of all you need to understand where to fit time series [00:16:33] data analysis so for this the the primary uh requirement is that data should be observed over time okay [00:16:54] so one more critical observation which you need to have in time is today's value may depend upon [00:17:01] yesterday's value observations can be correlated across time and the time itself can have trend and [00:17:08] seasonality which can repeat over time so a classical example of this is the temperature so today's value [00:17:17] definitely will depend upon yesterday's value but suppose if you say today's value is it depend [00:17:23] upon the six months uh earlier value so that would say you will say that it was a different season [00:17:31] and in that definitely not because summers are way warmer than the uh autumn or uh winter so you can [00:17:40] see it may be one month it will only depend upon the last one month but not the whole year so that's [00:17:47] why time series is special we are not considering all the data but we will see there is a seasonality [00:17:53] is involved where we need to consider certain period of time to predict so if you say uh predict the [00:18:01] temperature of tomorrow if you can take the average of last seven days it may give you a correct value but [00:18:07] if you say take up average of a last three months or four months you may not get the correct value okay so [00:18:15] that's why you yt yt yt is the time which you have today is dependent on the yesterday or day before [00:18:22] yesterday but not always there may be a trend or season till where it is dependent so there is a [00:18:31] classical examples of time series data or weather data collected over date over every day or rainfall [00:18:39] corrected again week or day pressure winds business you collect the sales information demand revenue [00:18:49] inventory to predict your future requirement that for example the next month how many units you need to [00:18:56] need in your inventory similarly for energy energy may also have a seasonal pattern for example you want to [00:19:04] predict the consumption in a city so it will slightly depend upon the month so you may see there is a [00:19:15] increase in consumption when there are high winters due to use of uh that is very cold temperature due to [00:19:24] use of geysers and use of room heaters and also uh there is a dependence on high temperature if [00:19:34] there is a temperature is very high you may need to have more air conditioner and all right [00:19:39] finance you have to see that how much prices are uh fluctuating you have to plan your investments and all [00:19:47] in healthcare you see the daily values of the patients and based on that it can be predicted also [00:19:54] it can be predicted that number of admissions based on the number of patients released in your hospital today [00:20:00] they may come tomorrow or day after tomorrow so they may have a similar trends if it is increasing [00:20:07] trend so that may be because of some epidemic or some uh in a uh small period of time and a lot of [00:20:16] increasing trend so that may be due to some uh small epidemic or some type of disease which is prevailing [00:20:22] and communicable as you have might have observed in the covet 19 so similarly you have to predict if [00:20:30] example the transport like number of the passengers are going from a city at a particular uh square [00:20:37] at certain uh location maybe one hour you have to see that 8 to 9 a.m you may relate that the traffic [00:20:46] is lesser that's why you plan to leave early at 8 to 9 a.m rather than 10 to 11 a.m which is the peak [00:20:52] traffic hours similarly in the evening time if you see the four to five four to six window is or five to [00:20:59] seven is very peak so you may plan to leave at 4 30 or so so that's why this things which are [00:21:08] which are seasonal they are repeating every day it's not like your machine learning can just predict [00:21:14] okay this is the traffic you will get so you cannot generalize right so those things require an [00:21:20] additional considerations and that are handled using time series analysis so we can uh yeah so that is what [00:21:29] i have told that how much traffic should you expect [00:21:35] yes so uh there is a question what is difference between cyclical and seasonal right so as i have [00:21:42] given you an example that uh seasonal is a example like uh which you are a behavior which you are observing [00:21:52] every week for example you are observing that is in the fixed time that is every saturday or every sunday [00:22:01] you observe that your number of kilometers which you walk are more than usual so that is seasonal right [00:22:08] right if you see a stock market so suppose a small uh stock market made a dip it has an increasing trend [00:22:19] and after that it is dipping so sometimes it dips after two years sometimes it has a recession kind of [00:22:26] thing after every four c four years so it is dependent upon some other thing which is not seasonal [00:22:33] but still it is cyclical because it is happening after some time but that some time is not fixed in seasonal [00:22:42] you will see it is happening after fixed time like it is repeating every week right clear action is it okay [00:22:52] so moving to our uh next point [00:23:04] so how we observe so we observe the past and we predict the uh uh future values in the time series [00:23:11] so our time series if you look at it so it will show you the observed values uh so suppose uh you may [00:23:20] start from the beginning so why one may be your first collection or first sample then it will have [00:23:27] one two three it is the increasing timeline so the time index t which we are referring here it may be an [00:23:35] hourly daily weekly monthly or quarterly for example the temperature you observe is hourly [00:23:43] then what are the daily values so there can be a daily like uh sun sunrise or sunset values weekly [00:23:55] weekly is like uh you can also have a amount of uh your uh working hours suppose eight hours a week [00:24:03] you uh eight hours a day you work someday more someday less so you can say that weekly this many [00:24:09] months hours hours you have stream time and all so monthly is like amount of expenditure and all you [00:24:15] can plan right so you will see the time the data is being uh congenerated or collected after every [00:24:24] cycle maybe it is a hybrid sorry every period which may be a daily weekly monthly also [00:24:39] so the time series forecasting means with the help of values which are given to us from uh beginning to [00:24:50] the end we are forecasting what would be the value estimate as yt plus one yt plus one means till today if [00:24:59] we have the data what would be the value of that event tomorrow okay so [00:25:14] the concept of notation of the lagged value so suppose we say today we observe using yt and yesterday is [00:25:23] yt minus one yt minus two periods then we have a yt minus three suppose we are recording the number of [00:25:32] kilometers every day which we are walking and we calculate lag one lag two lag lag one is the value [00:25:40] which you calculate it with a day the value which is uh associated with the previous day the trend which [00:25:48] you follow lag two is if you have a two days difference so if it is a value 200 and if it is a lag one [00:25:54] you will see the same value right previous day if you see there is a two days difference so you will [00:26:01] have a 200 and then you will have it as a t minus two also 200 value now if i am talking about uh kilometers [00:26:08] and if i am talking about that lag six that is or lag seven that means i am talking about the week day [00:26:18] right and i am talking about the number of days in a week so if i am talking about uh monday here so [00:26:26] lag t minus seven will also give me here the monday and if i see the value of uh today and t minus seven [00:26:35] that is that value which i observed last week the same day is similar then means it is very high [00:26:42] correlation with this value and there is a trend of a seasonality that the value is being repeated after [00:26:49] every seven days okay so [00:26:59] just to know about an example that how there can be an increase of trend or a decrease trend so you [00:27:05] can see uh this is a five days consumption of electricity 8 28 50 so you can see monday tuesday [00:27:14] wednesday thursday friday so there is a increasing trend so friday is always higher so this is one week [00:27:22] trend if you see another week also same thing if you see another week also same thing so you will see [00:27:28] that this is the trend is follow if not then there may be a noise like uh is there any uh friday which is [00:27:38] usually hotter comparatively due to which the amount of uh amount of energy which was required was more right [00:27:49] yeah yeah so this we have already discussed this uh cross-sectional versus time series suppose as mars of the [00:27:58] student will move forward so if we want to form [00:28:06] uh uh forecasting problem so from observations so we need to analyze the historical data [00:28:15] uh explore patterns choose model fit model forecast and evaluate so you will see this is the thing [00:28:22] historical data machine learning algorithms mostly dependent on the historical data and the explore [00:28:29] patterns this is done implicitly but in the time series you see there are explicit pattern that's why you [00:28:37] need to model it differently with the help of some different type of uh statistical methods [00:28:45] okay we'll see so our trend let's come back to the trend and look at it at a deeper at a more depth so [00:28:59] suppose there is a long-term increase or decrease in that level of series for example there is a population [00:29:05] growth sales or technology technology adoption [00:29:15] so the most importantly if you see if their trend is linear it can be modeled over time like using a [00:29:27] uh using a line or a linear equation that is a plus bx where x is the intercept here it will become [00:29:35] the x value will be like the previous values right so a is the your intercept and b is the slope [00:29:44] okay so value of y when x equals to zero that is your initial condition okay and slope is calculated using [00:29:52] sigma xy sum of this both the values divided by x square that is the value which is you are having [00:29:59] at a particular t so what is important here to note is that when we are analyzing the trend we are not going [00:30:08] to calculate like a linear regression all the values which were there but we will see only part of it [00:30:14] that's why it becomes a linear for example the population growth only follows for last three years [00:30:21] the correct trend otherwise the trend was different so in that case your model may not be correctly model [00:30:26] your value so just to calculate if you want to calculate with what pattern if it is a linear trend [00:30:34] so if you are given a data of annual sales for five years and for year 21 to 25 the sales is [00:30:43] uh 10 12 15 18 20 and this you centered across a mean or a center value so you will get x as minus 1 [00:30:52] minus 2 and then you go further to 1 and 2 so this will become your 24 and 25 years so you can calculate [00:31:01] the x y and you can calculate x and with this uh slope and intercept you will find that the trend which is [00:31:09] fitting this uh uh data is uh yt equals to 15 plus 2.6 x so now you keep any value that is uh yt will give [00:31:21] you the yearly sales and this is the one x will be your value which is the in terms of which is here so it [00:31:28] will be minus 2 to 2. so if you put each in here you will see that it is approximately directly [00:31:36] forecasting the sales so this is modeling this trend so this is how you can model a trend in a time series [00:31:48] so as we discussed that seasonality can be a regular monthly sales or something which can repeat [00:31:56] over time for example the energy consumption or a monthly retail sales so which repeats over time [00:32:03] because due to due to festival suppose uh in month of october you will observe there the sales are more [00:32:10] if there is an electricity you will see in month of summers or in month of uh some uh winters you will [00:32:21] see that the sale is more for example the sales of ice cream so that is more in the summer season in [00:32:27] comparison to the winter season so you will see there is a trend like it is going up and then going [00:32:33] winter down then going up and down so you will see there is a pattern here like this so suppose i will [00:32:41] use this like a pan so suppose you will see the trend it is going like this and going up going up so [00:32:47] the peaks which you will see so these peaks will be corresponding to the summers and this will be [00:32:54] winter so the if you see the sales of a ice cream right so it have a seasonal value so now [00:33:04] to understand this seasonal term uh we need to understand what is the correlation between [00:33:12] the current value and our value which is recorded previously so we need uh to know that what is the [00:33:20] seasonal value that for example if i taking if i'm taking the sales of a monthly sales over a year so [00:33:29] in that case i have to see the lag 12 to get the same seasonal value or same month value so auto correlations [00:33:40] checks whether the series is similar by shifting into the k time steps so we compare it with the [00:33:48] observation so yt would be compared from the yt minus k the k maybe here will be 12 for [00:33:56] monthly for uh for a monthly data you have to repeat till 12 so it may be a seasonal okay [00:34:03] uh we will see all these terms what is this rho k so how this correlation you calculate so why it is [00:34:13] auto correlation so auto regression is predicting from itself so auto term itself so don't confuse [00:34:22] about regression you will predict the value but auto is about the self so that's why it is auto regression [00:34:28] correlation correlation also it is with the self but the previous recorded value so previously t minus [00:34:34] one t minus two values all of its same uh observations or the same parameter so you can define the auto [00:34:43] correlation using the variance and using the mean okay so you can calculate auto correlation as a [00:34:53] covariance under root variation of x t that is the t equals to when lag is zero and when t minus k okay t minus k [00:35:06] means you will calculate the correlation okay t minus k means you will calculate the correlation [00:35:10] at xt of xt with xt minus k and this k will vary from k will vary from this k will vary from k equals to [00:35:24] 1 to suppose it is a seasonal so monthly uh if it is a monthly data so you may need to repeat it well but [00:35:33] it may uh you can do till k and that k you can determine using the rho k value okay so whenever [00:35:46] the rho k value that is a auto correlation function so this value is around 1 that means it is highly [00:35:54] correlated that means xt and xt minus k are highly correlated if it is a negative then that means that [00:36:02] is a highly opposite so suppose this is your correlation and this is correlation so for this [00:36:12] both uh intervals you will see this value will be correlated with this one so this is when the rho k [00:36:18] will be one when this and this is there that means the correlation will be around minus one so you will [00:36:24] have the maximum one to minus one values okay so going further so let's see this with the help of the [00:36:34] example suppose this is the time series data which you have for 16 values of four years and each value is [00:36:43] collected quarterly that means this is the value of q1 q2 q3 q4 year one then year two q1 q2 q3 q4 [00:36:53] then you have q3 q3 q4 okay so what we need to do to compute q variance because you need to [00:37:04] compute the mean then you can subtract the mean and then you can calculate the variance and once you [00:37:11] compare this with you get the variance with like zero this is the value you will get you may try yourself [00:37:18] also once i can share the slide but these are the calculated value very basic maths using the [00:37:23] statistical mean and variance which you are studying from long time then you can compute the auto k [00:37:30] covariance at each leg okay so it is denoted by ck and you will see it will repeat it from t [00:37:37] equals to 1 to t equals to n minus k okay so this is repeated from t equals to 1 to t equals to n minus k [00:37:46] where you will have a lag between t plus k and dt so for k equals to 4 so you will have d with d5 d1 you will [00:38:00] compare d1 with d5 if d2 with d6 d3 with d7 and so on so for each of the values you will calculate and [00:38:09] you will get for example if it is 2 then you will calculate with d1 and d3 so and you will calculate [00:38:17] all these values so you will see the correlation that is ck and rk rk is the rho k which is divided by [00:38:24] this is at your lag 0 and this is at lag k okay so you will see there is a correlation at lag 0 1 2 3 7 [00:38:37] and now you see the lag 0 there is a correlation 1 after that you see there is a positive correlation [00:38:47] correlation of 0.7 again you will see there is a positive correlation auto correlation at season 8. [00:38:55] so with this you can have a idea that the seasons which you are getting the seasonality is 4 because [00:39:04] that means in every quarter suppose it is a month uh quarterly sales and the q3 sales is always higher [00:39:13] right so you will see there is a there is a positive correlation with the seasonality 4 so you can say [00:39:23] the s equals to 4 is the value [00:39:30] so what we need to see for the seasonality we have to [00:39:34] see three things so we have to see the peaks at multiples of a fixed lag so we see r4 was 0.7 r8 [00:39:46] was 0.43 so it was a positive so it gives us the observation that the seasonality can be 4. [00:39:52] okay roughs at half period that means this is a negative correlation with 0.6 and 0.5 which are negative so [00:40:04] near zero values at the end of the odd lag this is what a cyclic trend will look like because [00:40:11] every time you will see after that it will again follow the same thing so lag 2 4 6 or they will [00:40:20] approach so this is the value you will get in the if you average it okay so how you conclude what would [00:40:25] be the seasonality so as we see there are frequent uh uh frequent uh you know uh peaks at uh period of [00:40:37] four so there are quarterly you will see the period of four after four period there is a uh seasonal behavior [00:40:46] okay then you can compare it with a some market analysis that why it is so then you can correlate [00:40:54] with it and if it uh confirms with your uh market uh understanding [00:41:02] that uh suppose your sales are higher in the winters or your sales are higher in the summer due to [00:41:08] some reason if it is a year condition conditioner definitely the sales will be higher in the [00:41:13] summers and low in the winter so there the the lower values will be having a correlation with the [00:41:19] lowest values in the winter so you will see every year it is repeating for a q3 you will have a sales [00:41:24] a spike okay you can also do that you can again do a yt minus yt minus 4 and compute the ac4 uh acf [00:41:38] that is autocorrelation function again by having a differencing so you compare you subtract the current [00:41:44] value with the value which was there in the e minus 4 and see what is the value so you will see that [00:41:51] this type of a spike which you will see that is disappeared because now once you defer it there [00:41:58] will be us some normal value so just to explain i was saying you the seasonality so suppose you [00:42:05] subtract this value with the this value then you will left with a very less values right so that's why [00:42:11] it is so you will not find a peaks in the autocorrelation function so that confirms that the serial [00:42:17] serial seasonality is not there so or you can conclude and confirm with this so this is a very [00:42:27] basic code which you can try you can import the numpy and you can try this uh acf model with the [00:42:36] quarterly sales values which we have used and you can print so you will see this is how the variation is [00:42:42] okay and if you plot the correlation function you will see there is a positive correlation there is [00:42:47] a lag for positive correlation there is a lag for always there is a positive correlation that [00:42:52] means it confirms the there is a seasonality why we are having here uh eight so the n lags means [00:43:00] number of legs which we are going to our total number of legs which we are trying it [00:43:05] is total lags eight but you find the best or the most value because this now the trend is going down so [00:43:19] anyway you will not have so that's why we have the n lag as eight you may also try with 16 and you will see [00:43:26] there will be peaks four eight will be having a little lesser peak 12 again you will have a little [00:43:32] lesser peak because you will see the seasonal value of one year is also correlated with the value of the [00:43:38] last year not from the last to last year so there will be a slight uh less because it is also following [00:43:44] an increasing trend okay to sum up what you have to do to understand seasonality you collect the series [00:43:52] then you have to see the even spacing there are some four plus cycles you can find after plotting [00:43:58] okay okay now if there is any trend you need to uh remove if it is present so what how you can do [00:44:09] remove the trend that we will see we can remove it by differencing then you center the series [00:44:15] by subtracting it from the mean and then apply the auto covariance and auto correlation you calculate [00:44:23] at these as each leg you get the values and you see so there is another test known as a lunch box [00:44:31] junk box text so if your p value is less than zero zero point five then it means there is a uh it is [00:44:38] fine so there is a auto there is a correlation and you find the seasonality if it is a uh greater than [00:44:45] zero zero point five then that means there are noise so this is just to reconfirm although the main thing [00:44:50] which you judge based on that is the auto correlation function values so it peaks at multiple of s s will [00:44:58] give you the seasonal okay so the question is does the increasing trend with a specific pattern [00:45:18] for a short period as shown that can be referred as a cyclical as it's not repeating following right so [00:45:27] again for cyclical that modeling cyclical is little different for cyclical you need to model using [00:45:37] uh different model you don't you cannot use just a seasonal variation first the the understanding is we [00:45:45] need to check step by step that there is an increasing trend then you model using increasing [00:45:50] trend and remove that increasing trend then if there is a seasonal behavior you model that seasonal behavior [00:45:56] and remove that after that you see there is a cyclical trend so for the short time right so if you follow [00:46:06] that our time series is following a cyclic trend for x to z then z to uh some other uh say t plus [00:46:16] 20 it is following some trend then again it is following season in that case it is random you cannot say it is just a [00:46:23] uh cyclical right but when we are going to model a time series we are going to consider [00:46:29] all these aspects that is cyclical seasonal and trend i will show you in some time the the model the final [00:46:40] model which you are going to make from the time series will have a combination of all these things [00:46:45] it's not the one thing so all those trends will be covered okay so just hold on for some time after [00:46:52] that we can see if you still have this question then there is a cycle so which have a long-term [00:47:01] behavior and also irregular noise which you are not able to model okay so uh you will see a time series [00:47:10] can have a components uh prediction model of the time series should have certain combo all of you should [00:47:17] be agree at the time with me that there may be a trend there can be a seasonality there can be a cycle [00:47:24] and there can be a random uh behavior also that came using some shock so all these things needs to be [00:47:31] considered while modeling a correct time series right for correct forecasting or accurate forecasting so [00:47:44] we will see our ideal model should have a trend analysis should have a seasonality analysis cycle [00:47:50] and random also so how you do that so to capture this part this is a random part you will have a moving [00:48:00] average okay so moving average is defined as the average of last uh five values for example i have given [00:48:11] you an example of the temperature so suppose the uh seasonality is about following a a pattern which is [00:48:21] when the data is highly correlated with a weak data which is of the previous week but in case of uh uh [00:48:31] moving average or if it is not a uh seasonal or a trend if it is a cyclical then in that case [00:48:41] you need to see uh it can follow till certain k values so moving average will give you example for [00:48:51] example uh for temperature last four days temperature may be highly correlated with the tomorrow's temperature [00:48:59] but if you just see yesterday's temperature you may not be able to predict and if you see that average of [00:49:08] one month temperature that also may not be accurate but if you take the last five months or last five [00:49:13] days uh sorry last five days temperature then it is a highly correlated so we calculate this using this [00:49:22] correlation partial correlation function and the uh moving average means we are just taking the values [00:49:30] which are last four or five days or last t minus till t minus q okay but each value till uh t equals to zero [00:49:39] to lag t minus q we will consider so that's why it is known as moving average so c is a constant mean of [00:49:46] the series which is constant because the series is stationary and epsilon not t is the noise terms [00:49:52] the times the time series and are the theta one theta two are the constant so once we have more uh data [00:50:02] and uh we model that our time series we need to apply and check the moving average so these parameters [00:50:09] value you can estimate so suppose you just want to take at the lag one uh value at the lag one so you don't [00:50:16] you need to just compute the xd as c plus epsilon not t so you will not have theta two terms theta three [00:50:24] and t minus three t minus eight terms okay so uh if you want to uh plot this so for that you need to have [00:50:34] a plot acf you need to plot auto correlation function and partial auto correlation function that [00:50:41] i will explain you so you can see this is the history of the uh market data so it is following this type [00:50:53] of data so you will see how moving average is able to uh predict the values of last five days using last [00:51:04] five days so you will see there is a very small correlation you will see that there is no uh single [00:51:11] thing there are multiple things there are multiple things this series is mix of many things so now [00:51:16] if you calculate a rolling average plot rolling average is the average where you take a 10 day [00:51:22] average rolling value 10 day value okay so if you take a 10 days value and try to model this 10 day value [00:51:32] as a rolling average and see you will see your the 10 day average is very close to the one which you [00:51:37] are going to actual series but suppose if you make it in a 15 day average will it be good no it will just [00:51:43] become a straight line like this okay so if it is a 50 day average then it will be not very good so you [00:51:51] see that what is the value but now the biggest question is how to analyze this day then how would [00:51:57] you know the 10 day is the value you have to see you have to see the last 10 days values only [00:52:04] why not 15 days why not 12 days and why not 8 days so the answer you will get from the partial auto [00:52:11] correlation function okay so uh that's the relation between so once you plot this uh acf and pacf so uh [00:52:20] acf will give you the values at a particular lag so you can see your trend is going from one to [00:52:27] uh so you at the last yt it is highly correlated and then this correlation is going down okay so [00:52:36] it is although not seasonal but you can see each value with each lab view there is a correlation so [00:52:44] that means there is some part of the cyclic variation which is you are able to model using the moving average [00:52:52] average so you can see here you have to consider till what you have to consider because after this [00:53:00] the terms become less than 0.2 okay so you can see till here the lag equals to from where you have seen [00:53:09] the lag goes to zero to lag equals to 70 you have uh you have plotted the partial auto correlation and [00:53:18] you have seen that auto correlation goes down after this so you need to consider till only seven legs [00:53:27] okay till 70 legs if it is further going down very going down so then that means it is not correlated so [00:53:35] you don't need to take the moving average beyond that okay so what is the value of the partial auto [00:53:43] correlation function extend uh x uh tells you so then how it is correlated with the values at [00:53:52] previous like like equals to one like goes to three like goes to four like also you see all there is a [00:53:58] there is a certain certain certain uh uh certain correlation is there but after that you will [00:54:05] see so there is some positive some negative some positive some negative okay [00:54:17] so this partial autocorrelation will give you the value of the covariance at t with t minus k [00:54:28] from t1 to tk plus 1 so you can see you have to check for all so that's why the partial correlation [00:54:37] function gives you the direct like k relation from 1 to k minus 1 okay so now [00:54:47] how to judge whether to take that autocorrelation function value is enough or not so those autocorrelation [00:54:54] function value will give you that idea that behind that there is very minimum correlation [00:55:00] okay from that line [00:55:08] so pacf isolates the direct correlation between the current observation and the observation at like k [00:55:16] so controlling for the influences of lags in between so you will see after that there is a no [00:55:24] correlation correlation and at p value where auto correlation uh p p means the lag 70 it often shows [00:55:34] a sharp cutoff after that there is no further so it will tend to follow the value near zero okay [00:55:45] now once you model all these things [00:55:47] so once you [00:55:58] so once you model all these things you need to see [00:56:04] now or you need to understand the stationary also also stationarity so a series to come to the [00:56:12] prime series before analyzing we need to make sure that it follows a stationary behavior that means means [00:56:19] should not live systematically and variance should remain seasonally reasonably stable okay so how you can [00:56:28] calculate you can see if our series if you are having a increasing trend and you will see the average will not be [00:56:38] be if you say last 20 values average which should be around last 50 values or or last uh next 10 values so that average will not be a [00:56:51] constant it will keep changing okay so for that to understand that whether you have a seasonality or not [00:56:59] you have a stationary you need to see whether your time series is following a stationarity [00:57:04] so to check stationarity you have to plot okay and with the help of differencing we can remove so [00:57:12] differencing can remove the trends also and strong 10 which can create a [00:57:19] which can create a further uh you know auto correlation so we need to [00:57:25] difference to check the correct stationarity so you will see if there is a time series given at yt [00:57:35] and there is a observation at yt minus one if there is a increasing trend you can subtract it with the [00:57:42] value of yt to yt minus one so this will remove the increasing trend and at the first uh [00:57:55] yes so when uh so please hold on we will see all the steps they will come together so uh when we solve [00:58:03] up formal model we will see that we apply all these steps one by one before final computing the prediction [00:58:12] okay so just hold on we will do that after that you can ask puneet so you can you need to do a [00:58:22] differencing so that you will see there is a there is a fixed pattern which is coming okay so there is [00:58:31] a linear increasing trend that will be lost so now if you take a second differencing second differencing [00:58:43] means again we are value whatever we got uh yt that is a delta yt is delta y is uh delta y is [00:58:52] yt minus yt man still you will have see that there is a trend then you can again differentiate delta yt [00:59:01] minus delta y minus t minus one and it will give you a delta square so usually t equals to zero or d [00:59:09] equals to one is common while d equals to two is sometimes appropriate so we may not always need [00:59:16] to go beyond d equals to three okay now here comes the solution puneet so we are discussing the arima [00:59:28] model so we have seen auto regressive where we have calculated the auto correlation between the current [00:59:35] values and the lag values so that will be captured using a auto regressive and a parameter is given [00:59:43] which is p so this will give you the lag value that you want to calculate at lag till lag p so this will [00:59:51] give you a seasonality integrated this is for the trend you use differencing to address non-stationarity [00:59:59] you make the series stationary by making the differences and then moving average so this [01:00:05] mostly handles the cyclic or past forecast errors so moving average so use past forecast errors and shocks [01:00:14] okay so this is the moving average we'll use so we have seen all these three things separately [01:00:20] how differencing works how auto regressive works using auto correlation function and moving average so [01:00:28] that's why the model to forecast the time series which you use is known as arima arima that is auto [01:00:36] regressive integrated moving average arima model so this is one of the classical model which is used for the [01:00:45] time series forecasting and it consists of ar auto regressive i integrated which removes the trend using [01:00:54] differentiating differentiating or differencing and then moving average okay [01:01:03] so why do we need arima so yesterday value may contain a values about today's value a recent unexpected shock [01:01:11] may affect the next observation so it may be a cyclic or it may be a uh uh uh uh it may be a you know [01:01:20] uh some raw changes a trend is there which it makes the stationary series non-stationary so the curry arima model [01:01:30] combines these three ideas into a single flexible forecasting framework so that's why we will be able [01:01:39] to calculate or forecast correctly with the help of arima so which is one of the most uh used model [01:01:47] so it contains auto regression auto regression means the ar model so you see there is a constant and then [01:01:57] there is a this is the constant for uh previous term so you will see how yt minus 1 yt minus 2 will t minus p it [01:02:07] is related okay so if you use ar1 so phi is positive that means there is a positive correlation at e minus 1 [01:02:17] okay then moving average so this is the c value this is the average and then epsilon so this will become [01:02:24] on the moving average 1 2 and 3 like q okay so what ar does ar uses the past observation and ma uses the [01:02:39] past shocks so both describe the temporal dependencies but in different ways okay because uh stationary uh [01:02:48] auto correlation is more with the with a some type of uh pattern and then i in arima is integrated that [01:02:57] is differencing so if d equals to 0 there is a no differencing in the series that means there are no [01:03:03] trends if d equals to 1 that is first difference you can subtract the yt to yt minus 1 d equals to 2 [01:03:11] okay so the b is known as backshift operator that we will use for simplicity okay [01:03:22] so if you have a arima model 1 1 1 means you have phi 1 so this is the auto [01:03:29] regressive term and then this is the moving average term okay this is the mean constant term okay and [01:03:36] differencing and differencing equals to 1 that's why you have a delta here delta yt minus 1 so you are [01:03:42] modeling delta y rather than yt minus 1. okay so back shift it just give you after the differencing [01:03:52] so this is the general arima equation will become okay so this will give you the differencing and this will [01:03:58] give you the value now the question is p d q right so you have seen here in the arima we are having uh [01:04:17] where is that [01:04:17] yeah so arima is denoted by p d and q so q is for moving average i is in for integrated [01:04:31] so how to find this correct value of p d and q right so d is for differencing [01:04:48] so let me first complete this uh model yeah so what is the use of auto correlation function to [01:04:55] calculate p what exactly moving you average used to calculate q and uh yes so right so moving average [01:05:04] will tell us that how if if our series contain a dependency or a behavior that is handled using [01:05:12] moving average we have seen that moving average separately so till where the partial auto correlation [01:05:18] function is there yes so let me just first complete this uh choosing p dq value and then we will discuss [01:05:33] more about this okay so with this you will understand so suppose you want to get the p dq values [01:05:40] as modeling decisions okay so you know the p value is required for auto regressive d is for differencing [01:05:47] and q requires moving average so this the answer to your question is the answer to your question is this slide [01:06:01] so this is the primary request site or the request site where your [01:06:06] the request site or the request site or the request site or the request site or the request site or the request [01:06:11] so if your values are correlated with today's values and also there are unexpected shock and also there [01:06:18] is a trend which is non-stationary so for all these things if it is there then your arima model fits in [01:06:29] right so the next question is how to identify this p d and q value so [01:06:36] so have you seen as you've seen the p value requires the autocorrelation function so we see the value of [01:06:43] autocorrelation function and partial autocorrelation function to to calculate p and q values and d is for [01:06:51] differencing okay so once you uh once you apply this and calculate the uh plot acf and dcf so you would [01:07:02] first of all the first thing the very first thing you have to see the differencing so you determine [01:07:08] whether the uh series is appearing uh stationary or not if it is not appearing stationary how you will [01:07:14] get calculate whether it is stationary or not by seeing that your average uh is so it has a constant [01:07:22] mean and constant variance if it is having constant variance and variance that means it is stationary if it [01:07:28] is not a stationary then you have to apply the differencing that differencing maybe d equals to [01:07:33] one you can start with and you can see if you get the again the mean variance is right then you can [01:07:40] move forward with the d equals to one most of the time d equals to one is sufficient d equals to two [01:07:46] will come in later on if for the complex model then you have to see the plot acf and pacf these are the [01:07:53] auto correlation function and pc pacf this will give you what p and q values are good okay then you need [01:08:03] to estimate the model using information criteria so uh and then you have to check for residuals which [01:08:11] are the constants in your equation and this you calculate using some method of calculating error like [01:08:20] root mean square or you can use a mean average uh or least square errors you can calculate the other [01:08:29] one you can select there is a model you can select yourself your other thing there is a model you can [01:08:35] select automatic once you select the automatic arima itself selects the best model and give you the [01:08:41] output so you can follow either this or this but for the understanding this one is the best so we should [01:08:49] follow this one okay so let's uh go to the time series so the first panel shows the time series here [01:08:57] so you can see there is a increasing trend it's not stationary right so you can see there is a repeat of [01:09:07] the trend so you may try with the d equals to one so you have to check stationary so stationarity series [01:09:13] typically have constant mean and constant variance okay so you can see here the series is not stationary [01:09:23] and you can also check this by augmented decade fuller function so if the adf static value [01:09:34] is uh negative or it is uh less than the critical value then you can see or you need to have a p value [01:09:42] the other one is you have to see the rolling mean and uh and you need to check the standard divisions [01:09:51] you can see here there is a rolling mean okay which is increasing so that's why the value is not less [01:09:57] than zero zero point five so you need to apply d equals to one so when you apply d equals to one so this [01:10:04] is the first differencing yt equals to yt minus one so this is your original observation so after differencing [01:10:11] you will get 10 10 okay so d equals to one is enough so you don't need to go to the second differencing [01:10:19] now you need to check the autocorrelation functions using uh the values of rho k so suppose this is the [01:10:28] data and you are calculating the mean uh you are calculating the uh autocorrelation function so this [01:10:37] will suggest till what uh value you need to calculate the moving average so this will give you the value [01:10:44] of this will give you the value of q so you will see and uh when you calculate the partial autocorrelation [01:10:52] function so till there the seasonality is there so you need to see the where the pacf uh goes down to [01:11:00] the zero so you have to calculate till here the lag okay so once you have a value of p and q identified [01:11:09] so uh you can uh so suppose let's go further so here like pattern you will see so for [01:11:16] for autocorrelation function you see in this series uh these are the positive at the lag one [01:11:22] at lag two lag three lag four lag five it is going to increase and with the help of partial autocorrelation [01:11:29] function you can see after 15 lags or after this it is very less so you need to see till here and [01:11:36] what is the best lag you get here so the p value will be determined where acf tails off okay so where acf [01:11:46] tails off you see here right so after 10 lags there are no particular lands then uh you can determine q [01:11:59] as the lag where your pacf tails off or your acf cut off so tails off means this is one the value [01:12:08] where you will see so you will see that that we have plotted till q so accordingly you can select the p [01:12:14] and q values and then you can fit the candidate using arima model so you can use those values and [01:12:23] inside arima model you will see there is a alkaline information criterion and bic which is basian [01:12:31] information criterion which is used to calculate the aic and bic value so if you have the lowest [01:12:38] aic and bic value after fitting the pd and q then you have to uh select those values so you can see [01:12:47] from here it is a uh case number of estimated parameters and l is the likelihood how model fits [01:12:56] and n is the number of sample size okay so uh you can try that after that the next thing is compare the [01:13:05] model and diagonalized residuals so you have some uh error term in that where you do not have any value [01:13:13] so you may start with some values and you start calculating mean average error and root mean square [01:13:21] error with the yt which is the actual value and yt is the predicted y cap t and with that you can see [01:13:28] which one fits best and accordingly you can do the uh this error calculation and see which one fits best [01:13:36] okay and accordingly you can uh upgrade the value of pdq so yeah so this lunchbox test this is for the [01:13:48] initially autocorrelation function but p value will be less anyway wherever you will select the correct line [01:13:54] okay so just to summarize now here all the points so you have to see the plot the raw series [01:14:03] so you see there are certain uh uh certain uh uh non-stationary content if it is non-stationary that [01:14:13] means mean is not constant and variation variance is not constant so you have to see that p value will [01:14:20] be less than 0.5 using adf function auto uh this function which is there or you see that there is [01:14:27] a rolling mean and standing standard mean which is not constant so you can apply with the d equals to [01:14:33] zero your series was like this and if you apply d equals to one that is first difference it will look [01:14:39] like this second differencing will uh lead to errors because you may have too many uh fluctuations so it [01:14:47] may it may it is not recommended if you get a d equals to one and after that you get the constant [01:14:52] average and variance then it is fine then you have to see the plot the acf and pacf plot auto correlation [01:15:01] function and uh pacf so the pacf plot will suggest you the uh place where after where this is zero so you [01:15:12] don't need to take the values after that so this will give you the uh p values that after that you [01:15:20] need to cut off so you just need to take the p till here and you will also see the acf cutoff so where [01:15:28] acf cutoff so you will see their acf cutoff so you can check these values so you will have i this is for [01:15:38] differencing and then you have ar and ma for that you find it using a acf and pcf plot and now you [01:15:46] try you see here p equals to one p equals to two so with the p equals to one and p equals to two so the [01:15:55] value which you will take from here okay so this will give you the most probable values that means [01:16:01] after this you don't need to consider but now again you have to see which one gives you the best [01:16:05] output okay so you see two is the p value d equals to one here the first differencing and q is the [01:16:15] value which is the second q is the value for the moving average so now once you fit in this arima [01:16:21] model you calculate you calculate you will see aic and bic values so these are the parameters which [01:16:28] are calculated based on the arima model we are not going details on why aic and bic give use the minimum [01:16:36] value but this is what they use uh considering uh the method so the one model which will [01:16:45] so you will see the one which will give you the best values for aic and bic curve so that is the [01:17:00] lowest value so you see the combination which is giving you the lowest value that is what you will [01:17:07] select okay so then you can compare the values and you can see the output and after that once you [01:17:16] diagnose that means you are comparing with the residual analysis and finding the values of the [01:17:21] parameters okay so these parameters are uh uh which will be learned [01:17:37] okay so the question is [01:17:53] how to uh on board tail-off part okay [01:18:07] so uh so for p so you will see the value which need to see for the p uh where is my mouse here [01:18:30] so the value which you need to see which is having the highest correlation so it was zero but you cannot [01:18:35] take zero so there will be one and two so you can see after one and two there is a very cut off [01:18:42] cut off means you can see the auto correlation values are further going down okay [01:18:51] and for moving average you will see after moving average that is a one moving average is one [01:18:57] then after that you see this psc plot again the values are going very low side [01:19:16] okay so there is another question on uh if we are using linear regression or this to make time series [01:19:26] stationary okay so or linear regression so linear regression itself is about non-stationarity so if [01:19:34] there is a non-stationary behavior and that's all you have that can be best model using linear regression [01:19:40] you cannot need to have time series but time series you are having multiple things which you are uh [01:19:46] multiple type of uh uh you know uh pattern which are best mod model using the parameters which we have [01:19:56] studied or which the patterns which we have studied so time series have this many parameters only or [01:20:02] like seasonality trend or some type of cyclicality if it is not there then it is just a [01:20:07] uh random values which you can just model using machine learning it does not follow any trend [01:20:13] because machine learning it the problem with the machine learning and the time series is the time [01:20:18] series is more specific to the uh specific type of pattern but machine learning is a general term [01:20:25] which you can use anywhere but in time series you need to have certain pattern and they are repeating [01:20:31] if you apply machine learning it will just give you a uh it will learn a lot of features but then you [01:20:37] have to have a lot of features here you just have a single value that is uh being given you don't given so [01:20:44] many values so that machine learning then that case requires so many parameters so many observation [01:20:48] but with the help of time series you are able to do that so yes so uh yeah so maybe you missed my [01:20:58] pointer but i anyway i was just saying that you need to see that where these values are going down [01:21:03] and accordingly wherever the values are greater than uh where they are larger much larger that gives [01:21:10] you the correlation so the the acf and pcf plot just give you idea about the correlation you can select [01:21:17] whichever you want and you see what gives you the best aic and bic values okay so you have to understand [01:21:25] how it is code moving average means you are making it to link to last few uh uh last few uh observation [01:21:33] and same thing with the lag k means you are making to fit to the exactly that particular lag case okay [01:21:47] for linear regression you don't need to make the data stationary now you can just uh apply whatever you [01:21:56] have uh which uh if you want to i'm not not here teaching you linear regression so linear regression [01:22:09] don't need to stationary you don't need to apply the time series uh principles or time series forecasting to [01:22:16] the linear regression linear regression itself is enough and it takes uh different parameters time [01:22:22] series is different but my i'm trying to explain you how it is different and how you will get better [01:22:29] prediction in case of uh using time series forecasting than linear regression so we are not talking about [01:22:35] the linear regression so just let me finish a few more things are there so uh if there are any further [01:22:42] questions we can take again so arima you can complete reasoning workflow plot stationary you have to see [01:22:48] differencing [01:22:58] so you need to have a acf pcf fit and then you have to [01:23:04] diagnose and then you can do forecast so for example you can also use the pandas and stat models which is [01:23:11] already present in the uh python uh so you can use from the arima model okay stat model is there and [01:23:19] then you can use the model fit and you get the model uh fit and then you can just print the value so you [01:23:28] can use the forecast evaluation using mean average error room mean square error mean average uh this uh [01:23:38] this uh this uh for forecast evaluation whether your forecast is uh correct or not [01:23:45] and then you can uh see uh what are the challenges with the arima so most of the time we [01:23:52] uh make mistakes like we use arima without understanding whether it will fit data or not [01:24:01] uh we may defer the series over like we may use d equals to two even if we uh not required we use choose [01:24:11] p and q arbitrarily but actually we need to plot acf and pcaf and we have to see what will be the correct [01:24:18] value which will work with this and uh yeah so using training as a so we just use the training error to [01:24:26] learn the parameter we ignore the seasonality so if now there is a very high seasonality is there then [01:24:34] there is another model which you need to use is sarima model as a rima okay so it may not be and very [01:24:43] accurate okay if your pattern also have that so the forecast we need to make sure that so there is a one [01:24:51] more uh algorithm known as sarima so that use uh some specific we have pdq p is seasonal auto regressive [01:25:01] order so that looks at the lag from previous season example from last india but seasonally seasonality [01:25:09] what it does it tries for every seasonal cycle okay and uh so pdq we have used but there will be the [01:25:17] extra extra term that is as length of the season cycle which they will take okay so that is how as [01:25:25] anima will model more on that [01:25:28] okay so what example weather forecasting you can use and this is the suppose this is the data you have [01:25:42] and you can apply the differencing okay so some questions are there i will answer in few minutes [01:25:48] so i'm just showing you if you want to put the temperature trend then you can forecast using the [01:25:53] five steps uh just you need to fit it in the arima and you can see the values of what is the acf and pcf [01:26:01] value you can use the d equals to one if it is a linear differencing okay and then you can apply the [01:26:09] arima okay so then a question is the question is uh uh okay so the question [01:26:16] of why value hence you sir can [01:26:24] okay okay okay okay got your point so do you know neural networks so what is the problem with the neural [01:26:35] network [01:26:38] you know what is the problem with the neural network suppose you are given you want to suppose you want [01:26:45] to go from here and you want to go to the market to buy vegetables okay which is just uh 50 meter or [01:26:54] 100 meters away from your home what you will take you have a bicycle you will have a you can walk or you [01:27:02] can take a car out of a garage and take 10 minutes and then you go there and you come back [01:27:09] what would you choose you would choose side bicycle or just a bike right because the mod the the data is [01:27:19] not that much parameters we are giving we are not giving uh too many parameters like sequence to [01:27:27] liquids like you are not given [01:27:29] it follows similar but it will use the seasonal parameter also one more extra we have not used [01:27:40] seasonal parameter with two uh so sorry my model it uses so we are not going to study that so uh to [01:27:47] answer to this first let me first answer this rnn part and all so the answer is very simple if you [01:27:54] can model the problem with a very simple solution which does not require so much a computation does [01:28:01] not require so much training does not require so much calculation which can be just a pretty straightforward [01:28:08] so that is the one with the help of the time series model why need to apply sequence to sequence [01:28:14] model complex rnn model which in fact takes a good time for inferencing it's not very as fast as [01:28:24] this arima model or time series focusing so why you want to use all those things with so many [01:28:30] parameters if you use a linear regression then you need to have more number of parameters to capture [01:28:35] trend cyclarity seasonal so many different different value of temperature pressure and all so in that [01:28:42] case it will become a multivariate linear regression and uh again but here we are able to do all those [01:28:49] things with very simply enough so definitely you can use more complex method like rnn it may give good [01:28:57] result or bad it may be there but still you can still use sequence to sequence model but still you see [01:29:03] the complexity the amount of training and amount of uh uh uh complexity will be more right [01:29:19] you can use any data in the kegels so you can just search in the times uh so there is a aeroplane flight [01:29:37] uh data in the para in the kegel you can try you can uh just search uh in the you know you can just search [01:29:44] in the uh kegel you can try there will there are a lot of uh data set and the code will also be available [01:29:53] on that but most important thing uh which i want to explain it the choice of the model even if you study [01:30:02] machine learning if you for a very simple task if you start using cnn will it be optimal no right it if it [01:30:11] is not required why you will go by uh why you will suppose there is already a temperature good enough [01:30:17] why you will need a ac although still ac will do that and you have a certain uh good ventilation the [01:30:22] answer is you need to use the appropriate model for your appropriate solve to solve the appropriate [01:30:28] problem it doesn't mean that for every time when you your work is done with a simple uh pickup when [01:30:36] you are why you need to bring a truck right [01:30:48] so that is the basic understanding to predict yes you can use it for the stock price prediction you can [01:30:54] use it uh for the and the data is anyway it is continuous across time you need in the time series [01:31:02] so there are some trend basic basic characteristics with time series data which has which i have [01:31:09] already you i have shown you so the basic characteristics of the time series data [01:31:14] so what is let's go to the first slide where you understand where to use and why to use [01:31:21] so the basic characteristic of the time series data is you have a trend seasonality variations [01:31:29] but still you will keep yes so you can use for the stock price prediction arima you can use [01:31:36] if it does not have a seasonality so it does not have a seasonality because uh uh because you do not [01:31:44] know that every season it behaves like every season so arima can be used [01:31:52] definitely you can use right [01:31:54] so to coming back to the time series data time series data we are not using complex neural network [01:32:06] we are not taking thousands of features if you give a deep learning a cnn model okay you give just a [01:32:16] try giving just one parameter it will not scale it will not give you the correct predictions [01:32:23] it will not model it will just give you the average of the values which you will get unless until you [01:32:27] have more number of parameters then only it will give just based on the yt based on the yt minus one [01:32:34] it is very difficult from a cnn and all to get the correct values even it is a sequence to sequence [01:32:40] model and all so that's why in the time series data we we are able to with the help of the signal [01:32:47] barrier itself we are able to model trend seasonality cyclic variation and all okay so that's the basic [01:32:56] difference you need to keep in mind if you find such type of data it is best uh if you have such type [01:33:04] of data which is having the uh this type of pattern then you can best use the time series so okay one [01:33:14] so this is the last question we will see [01:33:17] so this is the last uh question we will see in uh okay series of model when you have multiple [01:33:27] input steps it must be yes [01:33:32] yes so yeah so there are different consideration if you talk about the lstm and rnn you don't need to [01:33:38] do this much pre-processing but for example there are uh uh not giving correct uh data then you can [01:33:46] see again that uh with what pattern or with what type of modification you can do so that may be your [01:33:52] contribution in that part okay so all all models are there you need to understand why you need to [01:34:00] need more study more model to understand which type of data will work in which scenario which type of [01:34:06] data will be good for this scenario so that is why you are reading now you are not reading just one [01:34:11] model that is lstm and apply everything in lstm right so that's why we need to know multiple models [01:34:20] that so that we can solve our problem optimally we can predict and we can classify okay so uh [01:34:30] so i think we can end our session if there are no further questions so i hope [01:34:34] uh it is uh uh you you have learned the basic concept so i would be uh sharing these slides i will give [01:34:43] the slides uh you will be getting it soon through through the course coordinators okay [01:34:55] so anything else [01:35:05] yeah so thank you very much thank you very much so i will stop recording here and