Re: Random number Newbie Question
- To: mathgroup at smc.vnet.net
- Subject: [mg37894] Re: Random number Newbie Question
- From: Marc Heusser <marc.heusser at CHEERSheusser.comMERCIALSPAMMERS.invalid>
- Date: Sun, 17 Nov 2002 06:44:42 -0500 (EST)
- References: <ar4o2t$5at$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <ar4o2t$5at$1 at smc.vnet.net>,
doofusmaximus at hotmail.com (Hugh McBride) wrote:
> Something which is probably obvivous to the casual observer
> but not me ...
> Can someone tell me how to get a numerical value for
> from a NormalDistribution[0,1]
>
> Random only returns a random value between 0 & 1
>
This loads the package which defines continuous statistical
distributions.
In[1]:= <<Statistics`ContinuousDistributions`
This represents a normal distribution with mean zero and unit variance.
In[2]:= ndist = NormalDistribution[0, 1]
Out[2]= NormalDistribution[0,1]
Here is a symbolic result for the cumulative distribution function of
the normal distribution.
In[3]:= CDF[ndist, x]Out[3]= \!\(1\/2\ \((1 + Erf[x\/\@2])\)\)
This gives the value of x at which the cdf of the normal distribution
reaches the value 0.9.
In[4]:= Quantile[ndist, 0.9] // NOut[4]= 1.28155
Here is a list of five normal\[Hyphen]distributed pseudorandom numbers.
In[5]:= Table[ Random[ndist], {5} ]Out[5]=
{-1.63994,0.987641,-0.475946,-0.598517,-1.04913}
Is this what you're looking for?
HTH
Marc
--
Marc Heusser
remove the obvious CHEERS and MERCIAL... from the reply address
to reply via e-mail