MathGroup Archive 2004

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

Search the Archive

Re: populate a list with random numbers from normal distribution?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg49908] Re: populate a list with random numbers from normal distribution?
  • From: "Dr. Wolfgang Hintze" <weh at snafu.de>
  • Date: Fri, 6 Aug 2004 03:09:27 -0400 (EDT)
  • References: <ceqtu1$jvr$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Sean,

there seems to be a slight misunderstanding in the usage of Continuous 
Distributions (see Help Brwoser for details and examples).

Here is how it works fine:

In[1]:=
Needs["Statistics`ContinuousDistributions`"]

Assign normal distribution to l1

In[2]:=
l1 = NormalDistribution[50000, 25000];

Caculate main parameters

In[3]:=
Variance[l1] // N
StandardDeviation[l1] // N

Out[3]=
\!\(6.25`*^8\)

Out[4]=
25000.

Create list of 1000 random values from that distribution l1

In[5]:=
ra = RandomArray[l1, 1000];

Check graphically

In[6]:=
ListPlot[ra];

Hope this helps.
Regards,
Wolfgang

sean kim wrote:

> hello group. 
> 
> I looked at the help browser but i can't figure this out. I weant to
> make a list of random numbers sampled from a normal distribution
> 
> In[90]:= Needs["Statistics`ContinuousDistributions`"]
> 
> l1 = Table[Random[NormalDistribution[50000,25000], Integer, {10000,
> 99999}], {1000}];
> 
> Variance[l1]//N
> StandardDeviation[l1]//N
> 
> 
> From In[90]:=
> Random::"randt":
> Type specification NormalDistribution[50000, 25000] in 
> <<1>> should be Real, Integer, or Complex.
> 
> Out[92]=
> 0.
> Out[93]=
> 0.
> 
> thanks in advance for any insights
> 
> sean
> 
> 


  • Prev by Date: Re: Reduce/Solve
  • Next by Date: Continuous Distributions
  • Previous by thread: Re: populate a list with random numbers from normal distribution?
  • Next by thread: Re: populate a list with random numbers from normal distribution?