2
$\begingroup$

Just curious if anyone knows why there is a tiny but definite difference between the standard deviation as calculated by the error propagation formula and the simulation. It is only a 0.2% difference and doesn't cause me any problems personally but I am curious which of the two would be considered more accurate?

Adding another zero to the rnorm function causes my computer to crash. But I repeated this code 10 times or so (very small variance) and I am confident that the mean is in fact 0.2% higher than it should be.

# This takes about 6 seconds to run
x <- rnorm(10000000,mean = 100, sd = 10)
y <- rnorm(10000000,mean = 100, sd = 10)
z <- x*y
# SD of x*y using simulation
sd(z)
# SD  of x*y using formula
(((10/100)^2+(10/100)^2)^.5)*(100*100)
$\endgroup$
  • $\begingroup$ yeah i read the formula is an approximation. So would the simulation be more accurate then? $\endgroup$ – John Mar 10 '13 at 18:11
2
$\begingroup$

They're not the same because the second formula is an approximation, isn't it?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.