Hi. In this video, I'm going to talk about ADA regression, another technique used with time series data. So let's recall regular linear regression, and it's usually assumed to be some sort of linear form of a model. In high school algebra you might have seen something like this, y equals mx plus some constant, where the line is something like this. This point here is the intercept term, that's your constant, and the slope of the line is represented by that m term there. In linear regression, you might see an equation that looks something more like y_i is equal to Beta_zero plus Beta_one x_i plus some error term here. Again, this term would represent the intercept term here, this is the slope with respect to x_i. But there are some differences between linear regression and autoregression. For regression, we need an input variable to predict some output variable. For example, how would studying, how much time you studied affect your test scores, your output variable? But autoregression is a process to find the relationship with of some data and the relationship with itself, its past data. So how is yesterday's inflation impact today's inflation? How does for example, today's stock price is affected by yesterday's stock price? So there's some autoregressive process there. So what is autoregression? It's a representation of a time-varying process, and it's used to explain linear dependence between a variable's future values and its prior values, its historical values. In finance, it's often used for example to analyze prices, a time series of stock prices, and we're trying to predict the next day's price based on historical prices. In mathematical terms, the autoregressive model with one lag or AR(1) is defined as y_t times Phi y_t minus one, plus Epsilon of t. Instead of in a linear regression you would have an x term here, the independent variable, but in this case, you have the current value or the tomorrow's predicted value based on its historical value, the one period prior. If you look at an AR(2) model, it uses not just the one period priors data, but to period prior. In general, AR(p) uses as many periods back as you want. Again, e of t is defined as white noise. So the question becomes, what is white noise? It's defined as such. Each of these error terms are distributed normal. It's assumed to have a zero mean or the average of all these error terms is assumed to be zero, and it is assumed to have some constant variance, and that's what this term here means, that it has some constant variance. Now that variance could be five, it could be 10, it could be whatever, but it has to be constant through time. Then the final assumption about white noise is that today's error term is not at all correlated in any way with the prior error terms, they're all independent of each other. Perhaps, it's better to look at an example. So let's look at an example of white noise. So in this our program, it's a really simple program. First, I'm going to use this command rnorm(5). That creates five random numbers from the normal distribution, so there's a distribution. I'm just going to pick five numbers at random from this distribution, it's standard normal which means it has a mean of zero standard deviation of one, and I get a five of these members and put it into this variable w. So there I've run the code and you can see I've got five random numbers; minus 0.81, minus 1.46, minus 0.552, etc. So let's plot these lines. You can see little dots there. If I want lines, I can say type equals L, and that'll give me a line plot. So let's do that, it'll be easier to see. There they are, in period 1 it's minus 0.815, it goes down to minus 1.46, then it jumps up to 0.552, etc. But it's really hard to get a sense of constant variance here, so let's look at a random normal 500 of these numbers and plot them using the same commands. There you have this jumping around thing. But if you look at this carefully, you can see that most of the time as across it's in the same bend, and that's what I meant about this constant variants, it's in the same bend. The other thing to notice is that here's the zero point here in the middle, and that's the average of all of these terms. So if I took the average of w2 it should be something close to zero. Mean of w2, a second white noise time series, and there it is, 0.04, so it's close to zero, it's not going to be exactly zero because this is a random draw, but it is that. We can also look at the standard deviation which is calculated using the command sd. There it is, it's close to one. So there you have it, that's what white noise looks like, and this is what autoregression is all about.