Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Re: basic monte carlo simulation


From   William Bishop <[email protected]>
To   [email protected]
Subject   Re: st: Re: basic monte carlo simulation
Date   Sat, 21 Feb 2009 05:40:09 -0800

Non-transitive dice would be something like:

    * die A has sides {2,2,4,4,9,9},
    * die B has sides {1,1,6,6,8,8}, and
    * die C has sides {3,3,5,5,7,7}.

A is likely to be higher than B
B is likely to be higher than C
C is likely to be higher than A

On Fri, Feb 20, 2009 at 3:48 PM, Martin Weiss <[email protected]> wrote:
> <>
>
> I hope you forgive me for not knowing what "non-transitive" means? My guess
> from your example is something like heavily biased? Still, -simulate- is not
> yet necessary...
>
> ***********
> clear*
> set obs 10000
> g firstdice=cond(runiform()<`=1/6', 1,4)
> prop first
> ***********
>
>
> HTH
> Martin
> _______________________
> ----- Original Message ----- From: "William Bishop" <[email protected]>
> To: <[email protected]>
> Sent: Saturday, February 21, 2009 12:43 AM
> Subject: Re: st: Re: basic monte carlo simulation
>
>
>> Thanks Martin.
>>
>>
>> What if the dice were non-transitive?  Is that where -simulate- comes
>> into play in order to generate the roll outcomes?
>>
>> Say something like:
>>
>> Dice 1: 1, 4, 4, 4, 4, 4
>>
>> so 4 is 5/6 and 1 is 1/6
>>
>> Rick
>>
>> On Fri, Feb 20, 2009 at 3:17 PM, Martin Weiss <[email protected]>
>> wrote:
>>>
>>> <>
>>> Normally, one would use -simulate- but this is more easily accomplished
>>> as
>>>
>>> ********* clear*
>>> set obs 10000
>>> g firstdice=1+int(6*runiform())
>>> g seconddice=1+int(6*runiform())
>>> g sumofdice=firstdice+seconddice
>>> *let`s see whether CIs conform to our idea of unbiased dice
>>> prop sum
>>> **********
>>>
>>> where you can edit the obs to the # of replications you want...
>>>
>>> HTH
>>> Martin _______________________
>>> ----- Original Message ----- From: "William Bishop" <[email protected]>
>>> To: <[email protected]>
>>> Sent: Saturday, February 21, 2009 12:08 AM
>>> Subject: st: basic monte carlo simulation
>>>
>>>
>>>> Trying to create a monte carlo simulation for throwing a pair of dice
>>>> with 6-sides, numbered 1-6 (each side equally likely, thus 1/6).  So
>>>> there are 36 combinations of dice rolls and the sum will always be
>>>> between 2 (1 and 1) and 12 (6 and 6).
>>>>
>>>> With a large number of simulations, we should get the probabilities of:
>>>>
>>>> 2: 1/36 = 0.02778
>>>> 3: 2/36 = 0.05556
>>>> 4: 3/36 = 0.08333
>>>> 5: 4/36 = 0.11111
>>>> 6: 5/36 = 0.13889
>>>> 7: 6/36 = 0.16667
>>>> 8: 5/36 = 0.13889
>>>> 9: 4/36 = 0.11111
>>>> 10: 3/36 = 0.08333
>>>> 11: 2/36 = 0.05556
>>>> 12: 1/36 = 0.02778
>>>> *
>>>> *   For searches and help try:
>>>> *   http://www.stata.com/help.cgi?search
>>>> *   http://www.stata.com/support/statalist/faq
>>>> *   http://www.ats.ucla.edu/stat/stata/
>>>>
>>> *
>>> *   For searches and help try:
>>> *   http://www.stata.com/help.cgi?search
>>> *   http://www.stata.com/support/statalist/faq
>>> *   http://www.ats.ucla.edu/stat/stata/
>>>
>> *
>> *   For searches and help try:
>> *   http://www.stata.com/help.cgi?search
>> *   http://www.stata.com/support/statalist/faq
>> *   http://www.ats.ucla.edu/stat/stata/
>>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index