# Random walk or not?

I'm trying to understand whether the observed time series can be described as a random walk or not.

When I check autocorrelations of the differences, none of the autocorrelation bars for the difference series exceeds the blue dashed thresholds. However, I was not sure whether it was enough, so I've tried the augmented Dickey-Fuller test on the differences. The p-value turned out to be high, so we could not reject the null-hypothesis of stationarity. While on its own, this does not necessarily mean that the difference series is not stationary, it is still confusing. Moreover, my intuition says that there is an increasing trend, but I'm not sure how to describe it.

Data:

Start = 1998
End = 2011
Frequency = 1
59 334 333 402 450 461 452 468 461 463 508 573 639 567


Your data looks random-walk-y to me. Intuition is notoriously unreliable when it comes to random walks; witness technical chart analysis for stock markets.

Let's put your data into context. Estimate the standard deviation of the differences, assuming a mean increment of zero:

foo <- c(59, 334, 333, 402, 450, 461, 452, 468, 461, 463, 508, 573, 639, 567)
stdev <- sqrt(mean(diff(foo)^2))


Next, simulate 20 bona fide random walks with this standard deviation. Plot their trajectories and add your data:

n.sims <- 20
bar <- matrix(rnorm(n.sims*length(foo),mean=0,sd=stdev),nrow=n.sims)
plot(seq(1,length(foo)),foo,type="o",pch=21,col="red",bg="red",
ylim=c(-max(rowSums(bar)),max(rowSums(bar))),xlab="",ylab="")
for ( ii in 1:n.sims ) points(seq(1,length(foo)),cumsum(bar[ii,]),
type="o",pch=21,bg="black",cex=0.6) Your data do not look out of place in this set of random walks.

• Nicely done, but then wouldn't we need a measure of "out of placeness"? E.g. for 3 of the 14 time points, the orange line is the highest. Is that "out of place"? Or the orange line's rise from time 1 to time 2 is very rapid, by eye, it might be the most rapid rise of any of the 20*13/2 or so "rises" in the whole set. Is that "out of place"? If we define a particular type of "oddness" it will be easy to come up with a measure of it. But a measure of overall oddness seems very hard indeed. All this is not meant as criticism at all (I +1ed your answer) – Peter Flom - Reinstate Monica Nov 28 '12 at 21:23
• Thanks for the +1 - and I certainly agree on operationalizing the "out of placeness". Which is hard, as you say. My feeling is that there is a nice critique of null hypothesis significance testing somewhere in this question. – S. Kolassa - Reinstate Monica Nov 28 '12 at 21:33
• I've critiqued null hypothesis significance testing many times. I've heard that Jacob Cohen (who wrote statistics books widely used in psychology and social sciences) wanted to call it Statistical Hypothesis Inference Testing, but his wife talked him out of it. – Peter Flom - Reinstate Monica Nov 28 '12 at 21:36
• In "The Earth Is Round (p < .05)", Cohen writes that he "resisted the temptation to call [NHST] statistical hypothesis significance testing". Nothing about his wife there... psycnet.apa.org/journals/amp/49/12/997 – S. Kolassa - Reinstate Monica Nov 28 '12 at 21:40
• @guy: oh, certainly. It's just that it's not straightforward. There are many test statistics you could use. If you prespecify one, e.g., the value after 10 steps, you can easily calculate its distribution under the null hypothesis. The problem starts if you look at this test statistic, don't like the result and look at another test statistic, until you like the result. And that there is really no "natural" test statistic, like the difference in means if you want to compare two groups. – S. Kolassa - Reinstate Monica Sep 24 '18 at 15:41