Kehl Dániel schrieb:
Dear Ignacio and Riccardo!
Thank you for your help! I understand now what the problem was!
The script is now:
loop 10 --progressive
loop 10000
genr u = normal()
genr u2 = round(u)
endloop
If I'm not missing something, this inner loop is just a waste of time
9999 out of 10000 times because you don't do anything with the generated
u and u2.
genr a = mean(u)
genr b = sd(u)
genr a2 = mean(u2)
genr b2 =sd(u2)
store xxx.gdt a b a2 b2
endloop
First I put the "--progressive" to the wrong loop.
The only problem is that this was a bit slow, with 10/10000 it took about 15 minutes.
See above.
But as I awaited: the standard deviation of the rounded series is
about 4% higher than that of the original one.
Once again, if anybody knows papers about this topic, please let me know (I hardly found
any).
I'm not sure what's the background for this analysis, but it seems to me
that in this case you could calculate the theoretical standard deviation
for the transformed series quite easily. u2 is a discrete random
variable, where maybe something like 40% of the mass is at zero (to get
the actual result, if Phi(x) is the cdf of the standard normal, this
should be Phi(0.5)-Phi(-0.5), then another 30% or so at plus and minus 1
(Phi(1.5)-Phi(0.5) and Phi(-0.5)-Phi(-1.5)) and so forth. No need to run
simulations.
I can easily imagine (in fact I find it intuitive in this case) that the
theoretical SD of u2 is higher than that of u.
HTH,
sven