Generating random samples from user-defined distributions
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.
View all articles by this author:
Katarína Lukácsy
View all articles with these keywords:
rsample, random sample, user-defined distribution function, inverse method, Monte Carlo exercise
Download citation: BibTeX RIS
Download citation and abstract: BibTeX RIS
|