Page 2 of 2

Re: How to estimate a random walk model?

Posted: Thu Jun 06, 2013 6:33 am
by startz
Yes, that gives a random walk with drift.

What do you mean by "driven?" Do you want to estimate a random walk without drift, and if so what parameter are you trying to estimate?

Re: How to estimate a random walk model?

Posted: Sat Jul 27, 2013 5:15 pm
by mfb
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)
and

Code: Select all

ls y y(-1)
are the same except that the estimated coefficients differ by one.

They are the same except that the estimated coefficients differ by one AND the coefficient in d(y) y(-1) is not significant (can't reject it's 0) whereas the coefficient in y y(-1) is close to 1 and is significant (having done steps 1 to 8 as defined in the beginning of this topic). Which means that, on average, tomorrow's price is about the same as today's price. Which means that the best prediction of tomorrow's price is today's price. That's how an efficient market should work if it can modeled as a random walk process?

Re: How to estimate a random walk model?

Posted: Fri Aug 21, 2015 5:35 am
by jugheadj
Does it matter what I choose as the initial value for the random walk?

Basically I am trying to compare my forecast of my ECM to that of a random walk forecast. So do I just estimate a random walk for the same time period (using the method you suggested) and forecast it then compare RMSE MAPE etc?

Re: How to estimate a random walk model?

Posted: Thu Nov 19, 2015 7:27 am
by gsourop
Hi everyone,

I want to estimate a Random Walk model under a recursive window (expanding). My observations are from 1973M01 to 2014M12, and sum into 504 observartions (from which I want to exclude the first 12 from my sample-I just used them to calculate the inflation rate). I want my first estimation to start at 1978M01, and take into account the observations from 1974M01 until 1977M12. Until now I have made the above:

' set window size
!window = 60

' set step size
!step = 1

' get size of workfile
!length = @obsrange

' declare equation for estimation
equation eq1

'calculate number of rolls
!nrolls = @floor((!length-!window)/!step)

'matrix to store coefficient estimates
matrix(2,!nrolls) coefmat ' where 2 is the number of coefficients

'series to store forecast estimates
series fcast

' set sample for estimation period
%start ="@first" ' @otod(@ifirst(ser))
%end="@last" '@otod(@ilast(ser))
'smpl {%first} {%last}

'variable keeping track of how many rolls we've done
!j=0

' move sample !step obs at a time
for !i = 1 to !length-!window+1-!step step !step
!j=!j+1

' set sample for estimation period
%first = @otod(@dtoo(%start)) '+!i-1)
%last = @otod(@dtoo(%start)+!i+!window-2)
smpl {%first} {%last}

' estimate equation - where the equation is y=ut
eq1.ls d(lspot) lspot(-1)
'store coefficients
colplace(coefmat,eq1.@coefs,!j)

' 1-period-ahead forecast
%1pers = @otod(@dtoo(%start)+!i+!window-1) 'start point
%1pere = @otod(@dtoo(%start)+!i+!window) 'end point

'*EDITED
if @dtoo(%end) < @dtoo(%1pere) then 'check whether the forecast end point is greater than the workfile end point
exitloop
endif

' set smpl for forecasting period
smpl {%1pers} {%1pere}

' forecast with command *forecast* (see also *fit*)
eq1.forecast(f=na) yf

' set sampl to obtain the 4th period observation
smpl {%1pere} {%1pere}

' store forecasts
fcast = yf
next

smpl @all
show coefmat
show fcast.line

d(noerr) yf

If I want to do the same with a Taylor rule, let's say the following specifications: I-I* = (infl-infl*)+(output_gap-output_gap*) , the "*" is for the foreign country, I will have to reestimate the output gap for every new estimation that come as I expand my window. Does anyone know how can I do that?

Thank you for your time!