Re: [R] Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)

2018-10-05 Thread hmh
Nope. This IS a bug: _*The negative auto-correlation mostly disappear when I randomize small samples using the R function '*__*sample*__*'.*_ Please check thoroughly the code of the 1st mail I sent, there should be no difference between the two R functions I wrote to illustrate the bug.

Re: [R] Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)

2018-10-05 Thread hmh
I got it ! thanks and sorry for annoying you with that. have a nice day, hugo On 05/10/2018 11:16, Deepayan Sarkar wrote: > On Fri, Oct 5, 2018 at 2:07 PM hmh wrote: >> On 05/10/2018 10:28, Annaert Jan wrote: >>> you discard any time series structure; >> But that is PRECISELY what a call a

Re: [R] Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)

2018-10-05 Thread Deepayan Sarkar
On Fri, Oct 5, 2018 at 2:07 PM hmh wrote: > > On 05/10/2018 10:28, Annaert Jan wrote: > > you discard any time series structure; > But that is PRECISELY what a call a bug: > There should not be any "time series structure" in the output or rnorm, > runif and so on but there is one. > > rnorm(N,0,1)

Re: [R] Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)

2018-10-05 Thread hmh
On 05/10/2018 10:28, Annaert Jan wrote: > you discard any time series structure; But that is PRECISELY what a call a bug: There should not be any "time series structure" in the output or rnorm, runif and so on but there is one. rnorm(N,0,1) should give on average the same output as sample(rnorm(N

Re: [R] Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)

2018-10-05 Thread Annaert Jan
On 05/10/2018, 09:45, "R-help on behalf of hmh" wrote: Hi, Thanks William for this fast answer, and sorry for sending the 1st mail to r-help instead to r-devel. I noticed that bug while I was simulating many small random walks using c(0,cumsum(rnorm(10))). The

Re: [R] Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)

2018-10-05 Thread hmh
Hi, Thanks William for this fast answer, and sorry for sending the 1st mail to r-help instead to r-devel. I noticed that bug while I was simulating many small random walks using c(0,cumsum(rnorm(10))). Then the negative auto-correlation was inducing a muchsmaller space visited by the random w

Re: [R] Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)

2018-10-04 Thread William Bell via R-help
Hi Hugo, I've been able to replicate your bug, including for other distributions (runif, rexp, rgamma, etc) which shouldn't be surprising since they're probably all drawing from the same pseudo-random number generator.  Interestingly, it does not seem to depend on the choice of seed, I am not su