Message-ID: <gs9djg$bbc$1@ger.gmane.org>
Date: 2009-04-17T08:11:27Z
From: Karl Ove Hufthammer
Subject: rnorm() converted to daily
Ken-JP:
> Does this have something to do with biases due to the relationship between
> population and sample-estimates as a function of n samples and sd? Or am
> I doing something wrong?
>
> -----------------------------------------------------------------------
>
> set.seed( 1 );
> x <- mean( rnorm( 100000, mean=0.08, sd=0.25 ));
> set.seed( 1 );
> y <- mean( rnorm( 100000, mean=(0.08/252), sd=(0.25/sqrt(252)) )) * 252;
> set.seed( 1 );
> z <- mean( rnorm( 100000, mean=(0.08/252), sd=0.001 )) * 252;
Yes, you?re doing something wrong.
While it is true? that rnorm(n, a, b) will give the same results as
rnorm(n, 0, 1) * b + a, it is *not* true that the above calculations
would return the same numbers. That?s the reason the the means
differ.
? True in practice, but not documented as far as I can see, so you
should not depend on it.
--
Karl Ove Hufthammer