Hi all,

in order to verify some results I did the following test in R (2.4.1., 
windows system):

X <- cumsum(rnorm(1000000))
for (i in 1:1000) {
  tmp                   <- seq(1,length(X),by=i)
  X.coarse              <- X[tmp]
  X.return              <- diff(X.coarse)
  X.scale.mean[i]       <- mean(X.return)
}
plot(X.scale.mean,type="l")

As X is a random walk with increments following a standard normal 
distribution, the mean of X should be 0. Further more, each "piece" of 
the random walk should also have zero mean - independent of its length.

Why is it then, that the plot of X.scale.mean shows a clear linear trend?

Is the generation of the random walk in some way biased or do I just 
miss some point?

Thanks for any enlighting
replies in advance
Oliver

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to