How to estimate a random walk model?
Moderators: EViews Gareth, EViews Moderator
-
- Posts: 9
- Joined: Fri Dec 19, 2008 12:46 am
How to estimate a random walk model?
anyone who knows this stuff plz help me....
Re: How to estimate a random walk model?
Basic idea is that a series behave randomly between the two successive steps. In other words, the change occurs randomly from one state to the next. Therefore, given the initial value, time path of the series cannot be predicted if it follows a random walk. Below, you can find instructions on carrying out such an exercise in EViews. In case you are a beginner in EViews, I explained them as "menu-driven" steps rather than "command line" or "batch mode" specifications:
1- Open EViews
2- Create a workfile (File/New/Workfile)
3- Define a structure at your own interest (for instance you may prefer Unstructured/Undated workfile with 100 observations)
4- Resize your sample (Quick/Sample) for the first observation (clear @all and type @first @first in the dialog box)
5- Generate new series by equation (Quick/Generate Series) and assign its initial value (type y = 10 in the dialog box)
6- Expand your sample (Quick/Sample and type @first+1 @last the dialog box)
7- Generate random walk series (Quick/Generate Series) by equation (either by typing d(y) = nrnd or y = y(-1) + nrnd in the dialog box)
8- Cover the whole sample period again (Quick/Sample and type @all the dialog box)
Please note that this is a random walk without drift. If you prefer to generate a random walk series with drift, you can add a constant term in step-7.
This is how you can specify a random walk series in EViews. Now suppose that you already have the series (e.g. y) and you would like to estimate it as a random walk process:
1- Open Equation Estimation dialog box in EViews (Quick/Estimate Equation)
2- Type your equation (either d(y) = c(1) or y - y(-1) = c(1))
3- Press OK and estimate the equation.
4- You should see (and verify) that the estimated coefficient value is insignificant and residuals are white noise.
If we specified a drift, then the estimated coefficient value would be statistically equal (i.e. fall inside the confidence interval) to the drift...
1- Open EViews
2- Create a workfile (File/New/Workfile)
3- Define a structure at your own interest (for instance you may prefer Unstructured/Undated workfile with 100 observations)
4- Resize your sample (Quick/Sample) for the first observation (clear @all and type @first @first in the dialog box)
5- Generate new series by equation (Quick/Generate Series) and assign its initial value (type y = 10 in the dialog box)
6- Expand your sample (Quick/Sample and type @first+1 @last the dialog box)
7- Generate random walk series (Quick/Generate Series) by equation (either by typing d(y) = nrnd or y = y(-1) + nrnd in the dialog box)
8- Cover the whole sample period again (Quick/Sample and type @all the dialog box)
Please note that this is a random walk without drift. If you prefer to generate a random walk series with drift, you can add a constant term in step-7.
This is how you can specify a random walk series in EViews. Now suppose that you already have the series (e.g. y) and you would like to estimate it as a random walk process:
1- Open Equation Estimation dialog box in EViews (Quick/Estimate Equation)
2- Type your equation (either d(y) = c(1) or y - y(-1) = c(1))
3- Press OK and estimate the equation.
4- You should see (and verify) that the estimated coefficient value is insignificant and residuals are white noise.
If we specified a drift, then the estimated coefficient value would be statistically equal (i.e. fall inside the confidence interval) to the drift...
-
- Posts: 9
- Joined: Fri Dec 19, 2008 12:46 am
Re: How to estimate a random walk model?
whitenoise wrote:anyone who knows this stuff plz help me....
thank you for your help... I have followed your instructions both first and second and with your second instructions I have estimated this equation for 82 data (which are a stock's prices)
Dependent Variable: D(Y)
Method: Least Squares
Date: 09/23/08 Time: 08:07
Sample(adjusted): 2 82
Included observations: 81 after adjusting endpoints
D(Y) = C(1)
Coefficient Std. Error t-Statistic Prob.
C(1) -0.022222 0.017916 -1.240347 0.2185
R-squared 0.000000 Mean dependent var -0.022222
Adjusted R-squared 0.000000 S.D. dependent var 0.161245
S.E. of regression 0.161245 Akaike info criterion -0.799513
Sum squared resid 2.080000 Schwarz criterion -0.769952
Log likelihood 33.38027 Durbin-Watson stat 2.615385
and
Estimation Command:
=====================
LS D(Y) = C(1)
Estimation Equation:
=====================
D(Y) = C(1)
Substituted Coefficients:
=====================
D(Y) = -0.02222222222
so is this coefficient p for this equation? and if so, is it possible to see exact ut s ?
Yt = pYt-1 + ut
as you guess I am trying to predict a stock's price. so thank you again for your consider.....
-
- Posts: 9
- Joined: Fri Dec 19, 2008 12:46 am
Re: How to estimate a random walk model?
I mean is it possible to form an exact model for stock's next price via ewievs??
Re: How to estimate a random walk model?
Regarding to your first question:
Yes, it is. As I understand, you are not completely clueless on the subject. My previous instructions were intended to provide you the spirit and the very basic idea behind the random walk. Because it is more interesting and tough concept than it looks. Now it seems that you are trying to test the efficient market hypothesis.
That equation (Yt = pYt-1 + ut) might lead to spurious results, if the dependent variable is not stationary. And it might also be the case in your equation, since you are using price data. Therefore, the equation you are trying to estimate should be modified beforehand. The correct form would be Yt-Yt-1 = ut, if the dependent variable followed random walk. In EViews terms, you can type your equation as d(Y) = c(1) in the estimate equation dialog box.
Regarding to your second question:
The residuals of this regression (u(t)) are stored in the workfile as resid after each estimation. Besides, you can retrieve the residuals of an estimated equation any time from within the equation dialog box (Proc/Make Residual Series).
Regarding to your third question:
If you conclude that Yt follows a random walk, then it means the future values are not predictable. What you can do is simulate its values (generating scenarios), since you know the statistical properties of the residuals (ut). And yes, you can do all these in EViews as long as you study the manual and become more familiar with EViews' features...
Edit: Startz is right. There has been a misspecification of equations, which might lead to confusion for future forum visitors of the subject. So, I corrected the misunderstanding.
whitenoise wrote:so is this coefficient p for this equation?
Yes, it is. As I understand, you are not completely clueless on the subject. My previous instructions were intended to provide you the spirit and the very basic idea behind the random walk. Because it is more interesting and tough concept than it looks. Now it seems that you are trying to test the efficient market hypothesis.
That equation (Yt = pYt-1 + ut) might lead to spurious results, if the dependent variable is not stationary. And it might also be the case in your equation, since you are using price data. Therefore, the equation you are trying to estimate should be modified beforehand. The correct form would be Yt-Yt-1 = ut, if the dependent variable followed random walk. In EViews terms, you can type your equation as d(Y) = c(1) in the estimate equation dialog box.
Regarding to your second question:
whitenoise wrote:is it possible to see exact ut s ?
The residuals of this regression (u(t)) are stored in the workfile as resid after each estimation. Besides, you can retrieve the residuals of an estimated equation any time from within the equation dialog box (Proc/Make Residual Series).
Regarding to your third question:
whitenoise wrote:I mean is it possible to form an exact model for stock's next price via ewievs??
If you conclude that Yt follows a random walk, then it means the future values are not predictable. What you can do is simulate its values (generating scenarios), since you know the statistical properties of the residuals (ut). And yes, you can do all these in EViews as long as you study the manual and become more familiar with EViews' features...
Edit: Startz is right. There has been a misspecification of equations, which might lead to confusion for future forum visitors of the subject. So, I corrected the misunderstanding.
Last edited by trubador on Sat May 23, 2009 12:37 am, edited 1 time in total.
-
- Posts: 9
- Joined: Fri Dec 19, 2008 12:46 am
Re: How to estimate a random walk model?
thank you for your help. I think I got it know. the process we are talking about testing, testing a random walk process. If the market is strong effective stock prices follow a random walk so It is not possible to predict expected price what Fama said in 1950......
-
- Posts: 9
- Joined: Fri Dec 19, 2008 12:46 am
Re: How to estimate a random walk model?
for 3732 data I had this output:
D(V) = -0.03709782312*V(-1)
and
CoefficientStd. Error t-Statistic Prob.
C(1) -0.037098 0.004418 -8.396117 0.0000
so, the coefficent is significant and the prices don't follow a random walk. But is it possible to get p via this equation=
p-1 = -0,037 and p= 0,96291 if so this is almost 1.???
D(V) = -0.03709782312*V(-1)
and
CoefficientStd. Error t-Statistic Prob.
C(1) -0.037098 0.004418 -8.396117 0.0000
so, the coefficent is significant and the prices don't follow a random walk. But is it possible to get p via this equation=
p-1 = -0,037 and p= 0,96291 if so this is almost 1.???
Re: How to estimate a random walk model?
At first sight, it may look a little bit counterintuitive and confusing. However, significance is all that matters. You should focus on the significance instead of magnitude. Although the value is very close to 1, it is actually statistically different from 1. That's why i tried to explain the basic idea of random walk first. You should do more exercise on random walk in order to fully grasp the concept. You should experiment with different values in addition to 1 and see how the impact changes...
-
- Posts: 9
- Joined: Fri Dec 19, 2008 12:46 am
Re: How to estimate a random walk model?
thank you again.....
Re: How to estimate a random walk model?
The correct form would be Yt-Yt-1 = (p-1)Yt-1 + ut. If the coefficient (p-1) is insignificant, then it means that the original series Yt follows a random walk. In EViews terms, you can type your equation as d(Y) = c(1)*Y(-1) in the estimate equation dialog box. Here the coefficient (c(1)) is exactly what you are looking for (p-1).
Here is my question about the above reply.
Using Eviews to OLS this equation, [Yt-Yt-1 = (p-1)Yt-1 + ut]
isn't ...
genr Diffy=y-y(-1)
equation model.ls Diffy c y(-1)
if you run d(Y) = c(1)*Y(-1)
it's just equal to .....
equation model.ls y c y(-1)
that is the original equation posted by whitenoise (Yt = pYt-1 + ut), which "might lead to spurious results"???
i dont know whether my understanding is correct. please advise me.
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: How to estimate a random walk model?
trubador wrote:That equation (Yt = pYt-1 + ut) might lead to spurious results, if the dependent variable is not stationary. And it might also be the case in your equation, since you are using price data. Therefore, the equation you are trying to estimate should be modified beforehand. The correct form would be Yt-Yt-1 = (p-1)Yt-1 + ut. If the coefficient (p-1) is insignificant, then it means that the original series Yt follows a random walk. In EViews terms, you can type your equation as d(Y) = c(1)*Y(-1) in the estimate equation dialog box. Here the coefficient (c(1)) is exactly what you are looking for (p-1).
Trubador, this isn't really right. Estimates of Yt = pYt-1 + ut and Yt-Yt-1 = (p-1)Yt-1 + ut are econometrically identical except for the -1 factor.
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: How to estimate a random walk model?
whitenoise wrote:thank you for your help. I think I got it know. the process we are talking about testing, testing a random walk process. If the market is strong effective stock prices follow a random walk so It is not possible to predict expected price what Fama said in 1950......
The intuition is right, but the details are wrong. The best forecast of the price at t+1 is the price at t plus the drift term. (and Fama was 11 years old in 1950)
Re: How to estimate a random walk model?
Trubador, this isn't really right. Estimates of Yt = pYt-1 + ut and Yt-Yt-1 = (p-1)Yt-1 + ut are econometrically identical except for the -1 factor.
why except for the -1 factor?
Yt-Yt-1 = (p-1)Yt-1 + ut
Yt-Yt-1 = pYt-1Yt-1 + ut
Yt = pYt-1 + ut
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: How to estimate a random walk model?
question wrote:Trubador, this isn't really right. Estimates of Yt = pYt-1 + ut and Yt-Yt-1 = (p-1)Yt-1 + ut are econometrically identical except for the -1 factor.
why except for the -1 factor?
Yt-Yt-1 = (p-1)Yt-1 + ut
Yt-Yt-1 = pYt-1Yt-1 + ut
Yt = pYt-1 + ut
I could have been more clear. As you suggest, you get the same value for p. I just meant that
Code: Select all
ls d(y) y(-1)
Code: Select all
ls y y(-1)
are the same except that the estimated coefficients differ by one.
Re: How to estimate a random walk model?
hi guys,
Does d(y)=c(1) give the random walk with drift? if so, how can the random walk without drift be driven?
many thanks
Does d(y)=c(1) give the random walk with drift? if so, how can the random walk without drift be driven?
many thanks
Who is online
Users browsing this forum: No registered users and 36 guests