Re: How to generate random X given only min, max, mean?
- From: "David Winsemius" <dwin$emiu$@comcast.net>
- Date: Tue, 27 Dec 2005 21:20:47 -0500
----- Original Message -----
From: <nomail1983@xxxxxxxxxxx>
> Suppose I know only -5 <= X <= 95 with Xmean = 75.
> I believe that means that P(-5 <= X <= 75) = 20% and
> P(75 <= X <= 95) = 80%, roughly. Right?
Certainly not in general. A uniform distribution from 74 to 76 would meet
the requirements specified. Even if you need a non-zero density over the
entire range, there are still an infinite number of distribution that could
satisfy those requirements.
> 1. Suppose that I believe X is uniformly distributed in
> each subrange. Then I could generate random X by:
>
> X = if RAND() <= .20 then -5 + 80*RAND() else 75 + 20*RAND()
>
That would work if you are forced to use 2 adjacent uniform distributions.
Which is not a circumstance to which very many physical or economic
processes would conform.
snip---
>
> 2. Suppose that I believe X is "nearly normally" distributed
> across the range [-5,95], but with a left skew that pulls
> the mean to the right.
Those appear to be contradictory specifications. A normal distribution is
most definitely symmetric. No skew, nada, zippo. If you want a distribution
that is bounded at -5 and 95 AND is unimodal AND is smooth, AND skewed, you
might look at the beta distribution. You seem to be using Excel or something
like it, and you can get the cumulative Betadist() from the canned
functions. If you want the density, you can just calculate the differences
over a small interval divided by the interval width. Try it with parameters
A=10; B=2.5. Another option, albeit not a smooth one, but somewhat "like" a
Gaussian (normal) distribution, would be a triangular distribution.
http://en.wikipedia.org/wiki/Triangular_distribution
>
> How would I generate random X? Perhaps
> something of the form (which is obviously wrong):
>
> X = NORMINV(RAND(), 75, 12.5)
Yes. Something of that form. The inverse function of the cdf with an
argument from the uniform distribution is a typical way to generate random
numbers from that cdf. Not that any of the Excel random number generators
necessarily do what Microsoft says they do. A Beta inverse is also offered
in Excel, perhaps that is what your prof is hinting you could use.
You might want to look at:
http://mathworld.wolfram.com/BetaDistribution.html
http://en.wikipedia.org/wiki/Beta_distribution
Errors or limitations in Excel:
http://www.stat.uni-muenchen.de/~knuesel/elv/excelxp.pdf
http://www.iro.umontreal.ca/~lecuyer/myftp/papers/wsc01rng.pdf
http://www.math.ucalgary.ca/~ware/amat483/papers/random_number_generators.pdf
And you might want to apply the hotfix for a bug in the RAND() function that
was introduced in Excel 2003:
http://support.microsoft.com/kb/834520/
For years statisticians have been pointing out the limitations and outright
errors in Excel. Microsoft has consistently closed its ears. I was just
watching the TV series Rome. Gates == Caesar? The fact that the business
community does not seem to mind the mistakes in Excel is just boggling.
--
David Winsemius
.
- Follow-Ups:
- Re: How to generate random X given only min, max, mean?
- From: nomail1983
- Re: How to generate random X given only min, max, mean?
- References:
- How to generate random X given only min, max, mean?
- From: nomail1983
- How to generate random X given only min, max, mean?
- Prev by Date: Re: Linear Combination of chi squared rvs
- Next by Date: Re: How to generate random X given only min, max, mean?
- Previous by thread: How to generate random X given only min, max, mean?
- Next by thread: Re: How to generate random X given only min, max, mean?
- Index(es):
Relevant Pages
|
|