MathGroup Archive 2005

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

Search the Archive

Re: Why can't I call Random[NormalDistribution[10.0,0.0]]?


rand[mu_,sigma_?Positive]:=Random@NormalDistribution[mu,sigma]
rand[mu_, 0 | 0.] := mu
MapThread[rand,{Range@3,Range[0,2]}]

{1, 3.0837, 1.44367}

You'd have

MapThread[rand, {array1, array2}]

Bobby

On Fri, 15 Apr 2005 04:48:13 -0400 (EDT), <barrowes at alum.mit.edu> wrote:

> Why can't I call Random[NormalDistribution[10.0,0.0]]?
>
> I get the error:
> NormalDistribution::posscale: The scale parameter 0.` is expected to be
> positive.
>
> It seems like I should get a random number with mean 10 and sigma 0. Or
> in other words, the result should 10 every time.
>
> In my program I want an array of number taken from different
> distributions
> Map[Random,Thread[NormalDistribution[Array1,Array2]]]
>
> And elements of Array2 may be 0 for which I woudl ike the corresponding
> value in Array1 returned. In fact,
> Random[NormalDistribution[10.0,0.000000001]]
> does return 10.0 as expected.
>
> This worked in 5.1, but now returns this error in 5.1.1.
>
> Anyone have an easy workaround?
>
> Thanks,
> Ben Barrowes
>
>
>
>



-- 
DrBob at bigfoot.com


  • Prev by Date: Re: Maping and Complex Addition
  • Next by Date: Re: What's the matter with this?
  • Previous by thread: Why can't I call Random[NormalDistribution[10.0,0.0]]?
  • Next by thread: Re: Why can't I call Random[NormalDistribution[10.0,0.0]]?