Re: Gaussian to uniform random numbers generator



Randy,
that's what i was looking for.
Thanks a lot!
J.

Randy Poe <poespam-trap@xxxxxxxxx> wrote in message
<f5e911d3-73fe-42b2-9159-c15ccff8e76b@xxxxxxxxxxxxxxxxxxxxxxxxxxx>...
On Mar 28, 8:45 am, "jael 1506" <jael1...@xxxxxxxxxxxxx>
wrote:
Hello,

I need to generate uniform or gaussian random numbers
depending on the area. I will explain myself:

Imagine a 0-1 normal distribution (e.g., numbers you can
generate using randn). 90% of the probability is located
between -1.645 and 1.645. 5% is corresponds to x<-1.645 and
the other 5% to x>1.645.

Now i want to substitute the gaussian pdf by a uniform
distribution in the interval [-1.645, 1.645] so that the
probability for all the points in that interval is the same
and the sum of these probabilities is 0.9 (i.e., the area
under the horizontal line describing the uniform
distribution corresponds to the 90% of the total area). The
resulting picture is: Gaussian (x<-1.645, cdf=5%) - Uniform
(-1.645<x<1.645, cdf=90%) - Gaussian (x>1.645, cdf=5%).

This distribution might be useful if you want to share money
among some people: The same probability if they are close to
you (e.g.,your brothers, uniform distribution) and less and
less probability as they go "further" from you (i.e.,
cousins, friends, neighbours, enemies, etc..., gaussian
distribution).

How could i generate these random numbers in Matlab giving
the mean, the standard deviation and the probability
assigned to the uniform region?

Sorry if i did not explain it correctly. I am not an expert
in statistics.

The standard way to generate random numbers from an
arbitrary distribution is to use the cumulative distribution.

1. Generate a uniform random number r in [0,1].

2. Find the number x such that P(X <= x) = r.

3. x is your output randum number.

The details of step 2 vary with the distribution. For you,
it might be something like:
2a. If r < 0.05 or r > 0.95, use the error function erf
to find
the appropriate x. (I have to scribble a little to get the
expressions right for this one, sorry).

b. Otherwise, calculate the fraction (r-0.05)/0.90, and
output x = -1.645 + fraction*(2*1.645). That's a linear
interpolation
from -1.645 to +1.645.

- Randy

.



Relevant Pages

  • Re: Cantorian pseudomathematics
    ... >> I understand the probability a divides n when we have a uniform ... >> But there is no uniform distribution on N, so I don't see what Han ... no way to do that with a countable set of discrete ...
    (sci.math)
  • Re: Calculus XOR Probability
    ... case where you have a uniform probability distribution over an infinite set of ... Um, I'm not a probability expert, but isn't it the case that given a ... distribution, you can say what the _expected value_ of a random ... uniform distribution will be recognisably ordinary pofnats, ...
    (sci.math)
  • Re: Cantorian pseudomathematics
    ... Han is talking about the probability that a randomly chosen ... >> segment of the naturals, and the limit of this probability as that initial ... > But there is no uniform distribution on N, so I don't see what Han ...
    (sci.math)
  • Re: Probability of picking a positive rational number at random
    ... by Lebesgue measure to a completely undefined probability distribution ... Classical probability is more limited than measure-theoretic ... Feel free to try to define a uniform distribution over all uniform ... distributions over all well-orderings of distributions over natural ...
    (sci.math)
  • Re: What would be the right test?
    ... Uniform distributions are continuous. ... DW> Perhaps you mean multinomial with equal probability at each value? ... of probability or statistics to refer to a multinomial distribution. ... to read all of the statistics texts in the world. ...
    (sci.stat.math)