Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
roy
 
Posts: n/a
Default how can I sample a number from a distribution?

I need to sample 100 numbers out of a specified distribution (normal or
other). So basically I know the parameters, and I need Execl to sample 100
numbers. How do I do it?
  #2   Report Post  
Eric
 
Posts: n/a
Default

Roy,

For a normal distribution,

=NORMINV(RAND(),mean,standard deviation)

Copy this down for 100 cells.

Eric


"roy" wrote:

I need to sample 100 numbers out of a specified distribution (normal or
other). So basically I know the parameters, and I need Execl to sample 100
numbers. How do I do it?

  #3   Report Post  
Jerry W. Lewis
 
Posts: n/a
Default

In principle you can use the INV distribution functions to do this with
any distribution other than Student's t. In practice, the INV
distribution functions are too crude for serious work (the exception is
NORMINV in Excel 2003). Also, prior to Excel 2003, the RAND() function
itself is not that random.

Since this is how the Analysis ToolPak generates random variables from
various distributions, hopefully the next version of Excel will do a
better job of it.

If a serious random number generator is not required,
=TINV(RAND(),df)*SIGN(RAND()-0.5)
would be the patch for Student's t.

Jerry

Eric wrote:

Roy,

For a normal distribution,

=NORMINV(RAND(),mean,standard deviation)

Copy this down for 100 cells.

Eric


"roy" wrote:


I need to sample 100 numbers out of a specified distribution (normal or
other). So basically I know the parameters, and I need Execl to sample 100
numbers. How do I do it?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
doubling a number X number of times Bob Excel Worksheet Functions 1 June 17th 05 12:54 AM
Creating a certain number of entries based on a number in a cell PPV Excel Worksheet Functions 4 June 16th 05 10:25 PM
Count Number of Characters in a cell? AHJuncti Excel Discussion (Misc queries) 2 June 16th 05 07:39 PM
Need number of Saturdays and number of Sundays between 2 dates Class316 Excel Worksheet Functions 1 June 10th 05 02:47 AM
How do I sort a column a unique number? ChelleA Excel Worksheet Functions 7 February 19th 05 10:38 AM


All times are GMT +1. The time now is 06:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"