[SciPy-User] generate integer numbers between 0 and 75 from a normal distribution
cassiope
fpm at u.washington.edu
Wed Jul 20 11:10:35 EDT 2011
So make yourself a function that re-samples the distribution if a
given draw
exceeds your boundaries. No, the result won't be perfectly normal,
but that
was already given by your non-normal boundaries.
There are many more complex ways of achieving this, mostly less
flexible
in terms of flexible mean/sd. If the mean & sd are fixed, you might
be able
to come up with a faster method that adequately approximates "normal"
from
a set of integer samples.
On Jul 20, 3:38 am, franck kalala <franckkal... at googlemail.com> wrote:
> yes I want to restrict these numbers between 0 and 75,
>
> 2011/7/20 Brennan Williams <brennan.willi... at visualreservoir.com>
>
>
>
>
>
> > For a normal distribution you would use...
>
> > scipy.stats.norm(loc=mean,scale=stddev)
>
> > but if you want to restrict the range of generated values to being >=0 and
> > <=75 you will need to use a truncated normal. Is that what you want to do?
>
> > On 20/07/2011 10:22 p.m., franck kalala wrote:
>
> > Hi list,
>
> > I want to generate number between 0 and 75 from normal distribution, what
> > can I use?
>
> > Thank you
>
> > --
> > **********
> > ++++
> > ---
> > *
>
> > _______________________________________________
> > SciPy-User mailing listSciPy-U... at scipy.orghttp://mail.scipy.org/mailman/listinfo/scipy-user
>
> > _______________________________________________
> > SciPy-User mailing list
> > SciPy-U... at scipy.org
> >http://mail.scipy.org/mailman/listinfo/scipy-user
>
> --
> **********
> ++++
> ---
> *
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-U... at scipy.orghttp://mail.scipy.org/mailman/listinfo/scipy-user
More information about the SciPy-User
mailing list