EconPapers    
Economics at your fingertips  
 

Generating random samples from user-defined distributions

Katarına Lukacsy ()
Additional contact information
Katarına Lukacsy: Central European University

Stata Journal, 2011, vol. 11, issue 2, 299-304

Abstract: Generating random samples in Stata is very straightforward if the distribution drawn from is uniform or normal. With any other distribution, an inverse method can be used; but even in this case, the user is limited to the built- in functions. For any other distribution functions, their inverse must be derived analytically or numerical methods must be used if analytical derivation of the inverse function is tedious or impossible. In this article, I introduce a command that generates a random sample from any user-specified distribution function using numeric methods that make this command very generic.

Keywords: rsample; random sample; user-defined distribution function; inverse method; Monte Carlo exercise (search for similar items in EconPapers)
Date: 2011
Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj11-2/st0229/
References: View references in EconPapers View complete reference list from CitEc
Citations:

Downloads: (external link)
http://www.stata-journal.com/article.html?article=st0229 link to article purchase

Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.

Export reference: BibTeX RIS (EndNote, ProCite, RefMan) HTML/Text

Persistent link: https://EconPapers.repec.org/RePEc:tsj:stataj:v:11:y:2011:i:2:p:299-304

Ordering information: This journal article can be ordered from
http://www.stata-journal.com/subscription.html

Access Statistics for this article

Stata Journal is currently edited by Nicholas J. Cox and Stephen P. Jenkins

More articles in Stata Journal from StataCorp LLC
Bibliographic data for series maintained by Christopher F. Baum () and Lisa Gilmore ().

 
Page updated 2025-03-20
Handle: RePEc:tsj:stataj:v:11:y:2011:i:2:p:299-304