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?
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?
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?
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?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks