in reply to Re: Skew normally distributed random numbers
in thread Skew normally distributed random numbers

The idea is to produce random numbers within a specified range, but with a skewed average. What you describing wil not only transform the average, but also the range.

Eg. random numbers in the 0 .. 100 will, over time, tend towards an average of 50. If the desired average was say 75, then your math will produce a set of values in the range:

( 0 - 50 + 75 ) .. ( 100 - 50 + 75 ) := 25 .. 125

Which will tend towards the desired average, but is the wrong range. (I did a similar thing with my first attempt above).

The transformation required is not linear, but statistical.


Examine what is said, not who speaks.
Silence betokens consent.
Love the truth but pardon error.
  • Comment on Re^2: Skew normally distributed random numbers

Replies are listed 'Best First'.
Re^3: Skew normally distributed random numbers
by fglock (Vicar) on Jan 28, 2005 at 13:05 UTC

    Actually, the AM says they want random numbers distributed normally, and that the range is specified as (mean - delta, mean + delta).

    I believe they want to change the mean, and keep the delta.

      Now you've said it, I can see that is a possible-- maybe, the more obviously correct interpretation--but if it is, I am confused.

      If you have a function that returns random numbers distibuted over the range x .. y, then--if the PRNG is any good--the mean will tend towards (x+y)/2.

      If you want a different mean with the same average delta, you just add the delta between the current and desired means to the low and high value of the range and your function will produce values in that range.

      I guess what I am saying is, if you want your numbers in one range, why produce them in another range and then add the delta to each one, rather than producing them in the desired range in the first place?


      Examine what is said, not who speaks.
      Silence betokens consent.
      Love the truth but pardon error.

        That's because his PRNG is not uniformly distributed. I try to show it in the ascii graphs below:

        Uniformly distributed: start avg end _____________ | | __| |__ Adding to start/end changes the avg: start avg end _____________ | | __| |__ Normally distributed: start avg end __________ / \ __/ \__ Changing only start/end may give strange results: start end ________ | \ __| \_______
      I'm sorry, I (the OP) was unclear. I want to skew the mean away from the median, but keep the range (median - delta, median + delta).