2
$\begingroup$

I am using simulations to make a calculation. I generate many random numbers from a distribution for each input and then I take the mean and standard deviation of the outputs.

I noticed that the mean output from the simulations is always slightly higher than the result would be had I not used the distribution. This is due to the distribution becoming more and more positive skewed at each operation.

This example illustrates what happens even though I simply used lower and higher bounds instead of random numbers from a normal distribution:

10(+/- 2) * 10(+/- 2)

8 * 8 = 64 (36 lower)

10 * 10 = 100

12 * 12 = 144 (44 higher)

The mean of the results is 102.7, not 100.

In this example, would I say that 10(+/- 2) * 10(+/- 2) = 102.7?

In my actual calculations, the result is fed back into the calculation in order to get an estimate for time 2. After time 10, the result is some 35% higher than it would be without using the distributions.

Am I going about this correctly?

$\endgroup$
2
  • $\begingroup$ If you're using R and trying to get the same random variables from a distribution, you can set the seed prior to generating the variables. types set.seed(100) (you can use any number, 100 is just for example), and it should generate the same 'random' variables for your distribtion each time. So if you want 100,000 random normal variables with mean=0 and sd=1, just do: set.seed(100) rnorm(100000,0,1) Is this what you're trying to do? $\endgroup$ Commented Mar 11, 2013 at 20:00
  • $\begingroup$ This question is answered at stats.stackexchange.com/questions/3707/…. $\endgroup$
    – whuber
    Commented Mar 11, 2013 at 20:35

1 Answer 1

2
$\begingroup$

This is called Jensen's inequality, and has to do with the fact that you are using a convex function (a square). It does not have anything to do with the seeds or distributions; you will always see something like that when you square things up.

$\endgroup$
4
  • $\begingroup$ So would I consider the results valid or is the inequality effect something I need to correct for? $\endgroup$
    – John
    Commented Mar 11, 2013 at 21:41
  • $\begingroup$ What you observe is unavoidable. I am not sure I understand what there is to correct for. It sounds like "I have a sine function, how do I correct for periodicity". $\endgroup$
    – StasK
    Commented Mar 12, 2013 at 16:47
  • $\begingroup$ for example if i want to find the area of a square that I measured as 10 x 10, and say after i simulate the error, I get an area of 101 plus or minus something. Would I actually say the area is 101 instead of 100? Otherwise I could say the area is 100 and use the 'plus or minus' calculated from the simulation. $\endgroup$
    – John
    Commented Mar 26, 2013 at 21:01
  • $\begingroup$ Nope, Jensen's inequality describes systematic biases. If you simulate areas of squares with a random length that has a mean of ten, the mean area will be greater than ten, and the exact bias will depend on the distribution you are simulating from. You can't say "It's 100 because the mean is 10". $\endgroup$
    – StasK
    Commented Apr 2, 2013 at 3:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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