Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Random number generation( b/w two limits) with a gaussian

  • To: mathgroup at smc.vnet.net
  • Subject: [mg109775] Re: Random number generation( b/w two limits) with a gaussian
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Mon, 17 May 2010 07:10:29 -0400 (EDT)

You cannot restrict the values and "comply to a gaussian distribtion." However, if you mean a standard normal distribution (i.e., you are limiting the range to within four sigma of the mean) then the damage done will be minimal.

CDF[NormalDistribution[m, s], m + 4 s] - 
  CDF[NormalDistribution[m, s], m - 4 s] // FullSimplify

erf(2 Sqrt[2])

% // N

0.999937

filteredData = Select[RandomReal[NormalDistribution[], {1000}], -4 < # < 4 &];

Length[data]

1000


Bob Hanlon

---- "elvisgraceland at gmail.com" <elvisgraceland at gmail.com> wrote: 

=============
Dear experts,
Is it possible to generate random numbers b/w any two limits (say b/w
-4 & 4 ) which would comply to a gaussian distribution ?



  • Prev by Date: Re: Latex, Mathematica, and journals
  • Next by Date: Re: Latex, Mathematica, and journals
  • Previous by thread: Re: Random number generation( b/w two limits) with a gaussian
  • Next by thread: Re: Random number generation( b/w two limits) with a gaussian