What are Time Series and Forecasting Video Lecture Transcript This transcript was automatically generated, so there may be discrepancies between the video and the text. Hi everybody. Welcome back. In this video we're gonna Start learning about time series and specifically just talking about what are time series and what is forecasting. Let me go ahead and share my Jupiter notebook so.This is technically a regression class task solving a time series or forecasting a time series. This is technically a regression task in supervised learning. We have a set of possibly a set of features along with a set of outputs that are numeric and continuous in nature. As we've mentioned before, this is a regression task, but there are some nuances to this task that have led to the development of an additional subclass of statistical and machine learning methods.So in this notebook we'll formally define a time series and provide some examples. We'll introduce the concept of a trend in a time series. We'll talk about seasonality in time series. At the very end we'll explain forecasting and how it's slightly different, what we need to change from what we're doing from just a regular non time series regression setting.So a time series is a sequence of data points X1X2... X sub T so here the T is the denoting the time. So this is the observation at time one at time 2 all the way at time T and it can't keep going. In essence, we're usually gonna stop at NN observations.And XT here is gonna collect, as we did with regression collection of M features, while YT represents a numeric variable of interest at time T so for the purposes of these notes, we're just going to assume that our time steps are evenly spaced.That assumption is somewhat loose. For instance, we'll look at some data that in this very notebook where in in practice in the real world, they're not technically evenly spaced, but in essence we're going to think of them as being evenly spaced. And also depending on the model and data set, it's possible that there will be additional assumption that we want to make on XT&YT, but for now this is just the bare level.So a slight departure from our regression data setup that you may experience in practice and we will experience in our time series notebooks is that you may encounter a time series where there actually is no corresponding set of features and the only data you have are the Y sub t's. And so we're going to learn how you can model these sorts of data sets in in these notebooks with I believe what is called univariate modeling, meaning that you only have a single variable that you can use in your modeling.So here are some examples from your everyday life that you may have encountered. One thing about time series. So if you've seen anything about average global temperatures to talk about climate change and global warming, that's a time series. The value of the S&P 500 index for the United States stock market is a time series. Daily cases, daily new cases of seasonal influenza and the United States, maybe since 1900, that would be a time series.Boston Marathon times from one year to the next over on the lifespan of the Boston Marathon, also a time series. So these are some examples of time series that maybe we encounter in everyday lives and we don't think about it. A lot of the data that a lot of people are interested in are examples of time series. So it's good to have some of these tools in your back pocket.So there are a couple of features of time series data that you may encounter, the first of which is a trend. So some time series are said to exhibit a trend if the values either tend to increase or decrease over time as over time means as T increases.And I think actually this should have space over time. So as time goes on, you tend to increase. There may be sometimes when you go down a little bit, but eventually you'll come back up or you'll tend to decrease. Those are trends. And so an example of this could be Google's parent company's stock closing price over time.So here we have the stock closing price from a little bit after into 2004 all the way to March of 2022. And so we would say here that if we were to look at this and we'd say that there's a trend of the stock price going up over its lifespan. So an increasing trend one second. Hello.Oh, there we go. Sorry about that. My microphone got unplugged. So back to this. We should note though, while this seems, it seems there is an increasing trend here. It's also possible that if we look at the wrong time period or at a different time period of the same data. For instance, here's a much smaller sample size. It looks like now the time series exhibits a downward trend.And so when trying to diagnose what trend there is in the data set, you need to be careful because the time window that you consider can greatly impact your conclusion. So over the lifespan, it seems like the Google stock has had an upward trend. Over the past few or over the first few months of 2020, it seems that the Google stock had a downward trend and you might be able to guess why that was.Another feature of time series that you may experience is seasonality. So a time series is said to exhibit seasonality if the value of YT demonstrates a repeating pattern of some fixed length over time. So one way you can think about this seasonality is like maybe some sort of sinusoidal behavior. So a sine curve, right?But this is not the only sort of repeating pattern you can have. What are I believe in physics called wavelets which are essentially big sums of trig functions that give you like kind of bumpy curves that repeat a lot. So time series can exhibit sort of this kind of repeating pattern. One example that we we will consider is this data set that I.I obtained from Project Tyco, which is linked to here, that has the weekly incidence of seasonal influenza in the United States from 1928 to 1948. And this is what that looks like. So this is seasonal, it has the flu season tends to have a peak.Every year, one peak per year and typical flu seasons. That tends to occur either at the end of late December or in the start of early January. Sometimes it is slightly.