+ Reply to Thread
Results 1 to 10 of 10

Random numbers generation

Hybrid View

  1. #1
    Registered User
    Join Date
    02-20-2013
    Location
    egypt
    MS-Off Ver
    Excel 2007
    Posts
    6

    Random numbers generation

    I would like to generate a set of random real numbers within certain rang (-n to +n) and have predefined mean and standard deviation

    Please Help

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: urgent help is required : Random numbers generation

    You mean truncated normal random deviates?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    02-20-2013
    Location
    egypt
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: urgent help is required : Random numbers generation

    No , the mean not equal to standard deviation

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Random numbers generation

    Pardon ?

  5. #5
    Registered User
    Join Date
    02-20-2013
    Location
    egypt
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Random numbers generation

    Sorry;

    Please ignore my last reply

    It is truncated normal random deviates


    To be clear in my question I need to generate 2300 random number between -1.65 to 2.2 with mean 0.5 and slandered deviation 1.2 is it possible by excel

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Random numbers generation

           ---A---- --B--- -----------------------------C------------------------------
       1       Mean    0.5 B1: Input                                                   
       2         SD    1.2 B2: Input                                                   
       3      Lower  -1.65 B3: Input                                                   
       4      Upper    2.2 B4: Input                                                   
       5                                                                               
       6    Prob(L) 0.0366 B6: =NORMDIST(B3, B1, B2, TRUE)                             
       7    Prob(U) 0.9217 B7: =NORMDIST(B4, B1, B2, TRUE)                             
       8                                                                               
       9   Deviates  1.935 B8 and down: =NORMINV($B$5 + RAND()*($B$6-$B$5), $B$1, $B$2)
      10             1.320                                                             
      11            -0.681                                                             
      12             1.100                                                             
      13             2.193                                                             
      14             0.108

  7. #7
    Registered User
    Join Date
    02-20-2013
    Location
    egypt
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Random numbers generation

    Thank you very much

  8. #8
    Registered User
    Join Date
    02-20-2013
    Location
    egypt
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Random numbers generation

    I have a problem

    The calculated Mean and SD is not as the input values. Please see attachment
    Attached Files Attached Files
    Last edited by ahmedhattab; 02-21-2013 at 06:31 AM.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Random numbers generation

    If you truncate a normal distribution, of course the SD of the surviving values changes -- you chopped off the tails.

    If you truncate it asymmetrically, of course the mean of the surviving values changes -- you chopped more off one side than the other. Quantitatively, the mean changes to

    = mean + SD^2 * (NORMDIST(lower, mean, SD, FALSE) - NORMDIST(upper, mean, SD, FALSE)) / Z

    where Z = NORMDIST(upper, mean, SD, TRUE) - NORMDIST(lower, mean, SD, TRUE)

    If you had a bunch of random values that had a certain mean and standard deviation, but a truncated distribution, those would not be normal deviates.
    Last edited by shg; 02-21-2013 at 03:00 PM.

  10. #10
    Registered User
    Join Date
    02-20-2013
    Location
    egypt
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Random numbers generation

    Excellent. Thank you for your help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1