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

From |
"Martin Weiss" <martin.weiss1@gmx.de> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: AW: re: basic monte carlo simulation |

Date |
Sat, 21 Feb 2009 17:57:41 +0100 |

<> So, William, as you can see from Kit`s reply, the -cond-s nest without a hitch. If you want more on that, try NJC`s (and his coauthor`s) tutorial: http://www.stata-journal.com/article.html?article=pr0016 The difference between one call to -cond- and several is that you have to create the uniform random numbers as a permanent (could also be temp, but would not make much of a difference here) variable, as you can see in Kit`s third line. If you simply nested -cond-s and tossed -runiform- calls for each one in there, these would deliver different values from the unit interval and the whole thing would not work... As for your -simulate- thing, look at -help simulate- at the bottom where you will find a nice template. I have always thought of MC analysis as a tool to investigate the behavior of an estimator where, say, the small sample behavior is unknown. What you want from it amounts to a test whether -runiform- is a good random number generator, because an obvious analytical result for your dice thing is available... HTH Martin -----Ursprüngliche Nachricht----- Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Kit Baum Gesendet: Samstag, 21. Februar 2009 16:52 An: statalist@hsphsun2.harvard.edu Betreff: st: re: basic monte carlo simulation <> William said 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 -------------- clear set obs 10000 g un1 = runiform() g firstdice=cond(un1<`=1/3', 2, cond(un1<`=2/3', 4, 9 )) prop firstdice -------------- likewise for second and third. Kit Baum, Boston College Economics and DIW Berlin http://ideas.repec.org/e/pba1.html An Introduction to Modern Econometrics Using Stata: http://www.stata-press.com/books/imeus.html * * 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/

**References**:**st: re: basic monte carlo simulation***From:*Kit Baum <baum@bc.edu>

- Prev by Date:
**st: RE: Help building an ado file from a do file** - Next by Date:
**st: problems with Windows Vista** - Previous by thread:
**st: re: basic monte carlo simulation** - Next by thread:
**st: problems with Windows Vista** - Index(es):

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