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']);
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.
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
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 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']);
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.
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?
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.
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?
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
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
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
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
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
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 :)
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
Hi, glad to hear you liked it. I will add that suggestion to my list! Thanks, Ben
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']);
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.
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
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)
}
Jesse Maurais That's great. Many thanks for this! Am sure it will be useful. Best, Ben
Thanks!
@@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']);
Amazingly explained. Probably the best video on this topic on internet.
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.
Wow this is really helpful..ive been really strugling with econometrics at uni..but these videos are so well explained! Thanks so much..Cheers!
Ben, you are absolutely mental. I really appreciate this, thanks so much!
GREAT Explanation! now is all more clear!
@Ben Lambert, I got addicted to your videos on Econometrics. Thanks
Really helps, best Time Series Econometrics videos on youtube, thanks !
you have explained this course very well.thank you very much.
Yet another amazing video. Thanks, Benny
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?
Love your videos, mate! Thank you so much!
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
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.
Great explanation. Thanks!
Great Matlab demo!
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.
I think 4:28-4:41 is some kind of intuition to understand the magnitude of p
You legend! Thank you very much for all your videos!
Hi Ben, thanks for your videos!
Thanks a lot for this video!
this is a great video!
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?
Can you explain the math again very slowly and clearly? :) Good illustrations!
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
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
Thank you, explained a lot.
Very good video. The et in the non stationary equation is IID as is the case with the stationary one?
what is Rho in this context? like how is it defined? wow this makes so much sense now, thanks!
think it's called the autoregressive coefficient...
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
@Peripo
They do...if their analysis is to be taken seriously.
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
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
Can someone explain how we got the conditional means for AR(1) process? Really confused about that.
You re just amazing
you're the best
Brilliant! Thanks!
That is great Sir
Thank you Ben
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 :)
What is rho?
You started with X(0) = 0?
really helpfull!
thank you so much
thank you ben
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
thanks