The qualitative difference between stationary and non-stationary AR(1)

  Рет қаралды 235,368

Ben Lambert

Ben Lambert

11 жыл бұрын

This video explains the qualitative difference between stationary and non-stationary AR(1) processes, and provides a simulation at the end in Matlab/Octave to demonstrate the difference.
clear; close all; clc;
n=10000; % Setting the number of time periods equal to 10000.
b=1;
rho=1; %This is the coefficient on the lagged part of x
x=zeros(n,1); % Initialise the vector x
x(1)=0;
for i = 2:n
x(i)=rho*x(i-1)+b*randn();
end
zoom=1.0;
FigHandle = figure('Position', [750, 300, 1049*zoom, 895*zoom]);
plot(x, 'LineWidth', 1.4)
ylabel('X(t)')
xlabel('t')
I also include the same in R (Courtesy of Jesse Maurais):
z = rnorm(1000)
gen = function(rho) {
x = numeric(length(z))
x[1] = z[1]
for (i in 2:length(z)) {
x[i] = rho*x[i-1] + z[i]
}
x
}
display = function(rho) {
x = gen(rho)
plot(x, main=as.character(rho))
lines(x)
}
for (it in 1:100) {
display(it/100)
Sys.sleep(0.5)
} Check out ben-lambert.com/econometrics-... for course materials, and information regarding updates on each of the courses. Quite excitingly (for me at least), I am about to publish a whole series of new videos on Bayesian statistics on youtube. See here for information: ben-lambert.com/bayesian/ Accompanying this series, there will be a book: www.amazon.co.uk/gp/product/1...

Пікірлер: 55
@MrScattterbrain
@MrScattterbrain 4 жыл бұрын
Ben, thank you so much for these videos on time series. And, in particular, for this one. This answered all little confusions and doubts that I used to have.
@SpartacanUsuals
@SpartacanUsuals 10 жыл бұрын
Hi, glad to hear you liked it. I will add that suggestion to my list! Thanks, Ben
@debashisbanerjee260
@debashisbanerjee260 2 жыл бұрын
Amazingly explained. Probably the best video on this topic on internet.
@luistato7437
@luistato7437 4 жыл бұрын
Ben, you are absolutely mental. I really appreciate this, thanks so much!
@tonyfang4970
@tonyfang4970 Жыл бұрын
Sketched the same thing in Python, hope it helps! import numpy as np import pandas as pd import matplotlib import matplotlib.pyplot as plt # define each datapoint as a normal r.v. def generate_datapoint(params): mu = params[0] sigma = params[1] return np.random.normal(mu,sigma) # Set the number of datapoints T = 100 B = pd.Series(index=range(T)) B.name = 'B' for t in range(T): # Now the parameters are dependent on time # Specifically, the mean of the series changes over time params = (t * 0.1, 1) B[t] = generate_datapoint(params) plt.plot(B) plt.xlabel('Time') plt.ylabel('Value') plt.legend(['Series B']);
@alvise2165
@alvise2165 4 жыл бұрын
GREAT Explanation! now is all more clear!
@ljw1419
@ljw1419 9 жыл бұрын
Really helps, best Time Series Econometrics videos on youtube, thanks !
@Hatorye
@Hatorye 4 жыл бұрын
Yet another amazing video. Thanks, Benny
@asadkhanbb
@asadkhanbb 5 жыл бұрын
@Ben Lambert, I got addicted to your videos on Econometrics. Thanks
@saulmirandaaliaga
@saulmirandaaliaga 5 жыл бұрын
Love your videos, mate! Thank you so much!
@elfadlaouielfadel932
@elfadlaouielfadel932 6 жыл бұрын
you have explained this course very well.thank you very much.
@harshitnarula8449
@harshitnarula8449 Жыл бұрын
Wow this is really helpful..ive been really strugling with econometrics at uni..but these videos are so well explained! Thanks so much..Cheers!
@Konzor
@Konzor 8 жыл бұрын
hey ben, Very helpful videos! Thanks for that! But i got a question: is there any playlist which cover the hole time series stuff? Can't find a playlist/course on you channel.
@neodrone1
@neodrone1 9 жыл бұрын
Great explanation. Thanks!
@JesseMaurais
@JesseMaurais 10 жыл бұрын
I just mocked up a similar simulation in R, but I animated it, increasing rho by 0.01 from 0 to 1 in each frame, at 2 frames per second, using the same white noise data. Watching how the data changes makes a lot more sense now. Thanks for the videos.
@SpartacanUsuals
@SpartacanUsuals 10 жыл бұрын
Hi Jesse, many thanks for your comment and effort reproducing the above in R. Would you mind sharing it below here? I think some people would potentially be interested to reproduce above in R. Best, Ben
@JesseMaurais
@JesseMaurais 10 жыл бұрын
z = rnorm(1000) gen = function(rho) { x = numeric(length(z)) x[1] = z[1] for (i in 2:length(z)) { x[i] = rho*x[i-1] + z[i] } x } display = function(rho) { x = gen(rho) plot(x, main=as.character(rho)) lines(x) } for (it in 1:100) { display(it/100) Sys.sleep(0.5) }
@SpartacanUsuals
@SpartacanUsuals 10 жыл бұрын
Jesse Maurais That's great. Many thanks for this! Am sure it will be useful. Best, Ben
@IanBorgessen
@IanBorgessen 6 жыл бұрын
Thanks!
@tonyfang4970
@tonyfang4970 Жыл бұрын
@@SpartacanUsuals Sketched the same thing in Python, hope it helps! import numpy as np import pandas as pd import matplotlib import matplotlib.pyplot as plt # define each datapoint as a normal r.v. def generate_datapoint(params): mu = params[0] sigma = params[1] return np.random.normal(mu,sigma) # Set the number of datapoints T = 100 B = pd.Series(index=range(T)) B.name = 'B' for t in range(T): # Now the parameters are dependent on time # Specifically, the mean of the series changes over time params = (t * 0.1, 1) B[t] = generate_datapoint(params) plt.plot(B) plt.xlabel('Time') plt.ylabel('Value') plt.legend(['Series B']);
@schnickerfritzel
@schnickerfritzel 8 жыл бұрын
Hi Ben! thank you for posting this video, helps me clear up my confusion :) Although I do wanna clarify one thing: so does this mean that non stationary AR(1) process is synonymous with random walk process? and it also follows a unit root?
@hedgehog_fox
@hedgehog_fox 6 жыл бұрын
Great Matlab demo!
@alexlo6393
@alexlo6393 6 жыл бұрын
this is a great video!
@becoruthia
@becoruthia 9 жыл бұрын
Thank you, explained a lot.
@nancyaliaga7079
@nancyaliaga7079 5 жыл бұрын
You legend! Thank you very much for all your videos!
@pedroluque7371
@pedroluque7371 6 жыл бұрын
Hi Ben, thanks for your videos!
@arthvini02
@arthvini02 10 ай бұрын
Thanks a lot for this video!
@justinlundgren50
@justinlundgren50 6 жыл бұрын
Brilliant! Thanks!
@kpatel306
@kpatel306 9 жыл бұрын
Hi Ben Thanks a lot fort this video. I have a query related to statiority test - do we required series to be stationary while doing the linear regression forecasting? e.g. forecasting based on economic variables. Thanks KP
@graceliao5978
@graceliao5978 6 жыл бұрын
you're the best
@alexgold432
@alexgold432 7 жыл бұрын
Very good video. The et in the non stationary equation is IID as is the case with the stationary one?
@Albert-cs1uh
@Albert-cs1uh 10 жыл бұрын
really helpfull!
@youngbin0200
@youngbin0200 6 жыл бұрын
You re just amazing
@rupikakhanna306
@rupikakhanna306 10 жыл бұрын
It was a very useful video for starters. I was wondering if you could post something on ADF and (weak form) stock market efficiency tests.
@jacinthdavid1122
@jacinthdavid1122 8 жыл бұрын
Can someone explain how we got the conditional means for AR(1) process? Really confused about that.
@shreyajain8028
@shreyajain8028 7 жыл бұрын
If there are 2independent and 1 dependent variable in a regression and DF test needs to be applied and the significance of the two independent variables is 0 and for dependent variable it is 0.1156. Which of the variables are having unit roots?
@gabriellegall8278
@gabriellegall8278 6 жыл бұрын
thank you so much
@louisbatalha8912
@louisbatalha8912 5 жыл бұрын
That is great Sir
@dudeB15
@dudeB15 3 жыл бұрын
thank you ben
@johncharles3907
@johncharles3907 6 жыл бұрын
Can you explain the math again very slowly and clearly? :) Good illustrations!
@javierromera1997
@javierromera1997 3 жыл бұрын
Thank you Ben
@ThuHuongHaThi
@ThuHuongHaThi 3 жыл бұрын
I basically understand this as: the closer rho is towards 1, the more time it takes for the time series to return to its mean
@volkanky
@volkanky 4 жыл бұрын
I have a question please help me ; I have a export data but ı reach the trend stationary process, so can I use this data for VAR analysis? how can I transform the trend stationary process to sationary process
@Institute.research
@Institute.research 5 жыл бұрын
need answer if some variables are at level and others are the first difference so what I can do so can go at first difference or at level and how the equation will
@mamadoudiaby4474
@mamadoudiaby4474 2 жыл бұрын
Hello sir, I am studing the debt sustainability of WAEMU countries. It is said in littterature that when dependent variable which is primary surplus and independent variable which is debt are both stationary this mean that there is sustainability. In my case both are not stationary and this signals unsustainability of debt. For my GLS regression I am wondering wether I should take those variables in level or differenced them first? Thanks
@tempvariable
@tempvariable 5 жыл бұрын
thanks
@MootBoogie
@MootBoogie 5 жыл бұрын
what is Rho in this context? like how is it defined? wow this makes so much sense now, thanks!
@zurzakne-etra7069
@zurzakne-etra7069 Жыл бұрын
think it's called the autoregressive coefficient...
@Sam-gn6og
@Sam-gn6og 5 жыл бұрын
The explanation of the ARX model you gave is very simplistic, would make a Control Engineer cringe. There is a mathematical stability theory behind the difference equations of the parametric models (ARX.....ARIMAX) Econometrists hardly know about
@Sam-gn6og
@Sam-gn6og 5 жыл бұрын
@Peripo They do...if their analysis is to be taken seriously.
@urabi3tube
@urabi3tube 7 жыл бұрын
I have a question it might be silly but it's very important, why when we analyse time series we use AR model or MA Arima in others words why we use the lagged values as explanatory variables??? please be advice :)
@larsahnlandnordfors9170
@larsahnlandnordfors9170 8 жыл бұрын
What is rho?
@nabeelsyed5228
@nabeelsyed5228 7 жыл бұрын
Hey Ben i have an exam next wednesday, its basically a stats exam and i have no idea what is going on in it, my prof doesnt know how to teach and i was hoping you could help me out please respond, my exam is covering a couple chapters, ill send u the topic when i get my textbook
@oscarlu9919
@oscarlu9919 4 жыл бұрын
I think 4:28-4:41 is some kind of intuition to understand the magnitude of p
@AngshumanPalKolkata313
@AngshumanPalKolkata313 3 жыл бұрын
You started with X(0) = 0?
Random walk not weakly dependent
3:00
Ben Lambert
Рет қаралды 24 М.
Time Series Talk : Stationarity
10:02
ritvikmath
Рет қаралды 275 М.
Best KFC Homemade For My Son #cooking #shorts
00:58
BANKII
Рет қаралды 72 МЛН
What is Stationarity
5:01
Aric LaBarr
Рет қаралды 74 М.
What is a Stationary Random Process?
4:04
Iain Explains Signals, Systems, and Digital Comms
Рет қаралды 13 М.
Unit Roots : Time Series Talk
13:53
ritvikmath
Рет қаралды 144 М.
An introduction to Moving Average Order One processes
8:08
Ben Lambert
Рет қаралды 145 М.
Non-Stationarity and Differencing
14:35
Justin Eloriaga
Рет қаралды 4,7 М.
Time series and first differences
8:13
Matthew E. Clapham
Рет қаралды 37 М.
Time Series Talk : Autoregressive Model
8:54
ritvikmath
Рет қаралды 321 М.
Econometrics - Stationarity in time series data
26:18
Hanomics
Рет қаралды 6 М.
[Time Series] Weak Stationarity
8:20
math et al
Рет қаралды 27 М.
路飞太过分了,自己游泳。#海贼王#路飞
0:28
路飞与唐舞桐
Рет қаралды 38 МЛН
Hardest Basketball Shots Ever 😳
0:35
Red Bull
Рет қаралды 25 МЛН
Amazing tools #shorts
0:35
SA VA
Рет қаралды 10 МЛН
ToRung short film: 🐶puppy is hungry🥹
0:32
ToRung
Рет қаралды 30 МЛН
Amazing tools #shorts
0:35
SA VA
Рет қаралды 10 МЛН