Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg56137] Re: [mg56106] Why can't I call Random[NormalDistribution[10.0,0.0]]?
  • From: Mitch.Stonehocker at sungard.com
  • Date: Sat, 16 Apr 2005 03:52:44 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Mathematica is giving a correct result
Random[NormalDistribution[?, ?]] /. {? -> 10, ? -> 0}
"NormalDistribution::posscale: The scale parameter 0 is expected to be 
positive."

to see this:
PDF[NormalDistribution[?, ?], x] /. ? -> 0
"Indeterminate"

You can always force a result by coding a function to do what you want
but please don't ask  Mathematica to.

Cheers,

Mitch Stonehocker




-----Original Message-----
From: barrowes at alum.mit.edu [mailto:barrowes at alum.mit.edu]
To: mathgroup at smc.vnet.net
Subject: [mg56137] [mg56106] Why can't I call
Random[NormalDistribution[10.0,0.0]]?


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


  • Prev by Date: Re: removing subelements
  • Next by Date: Re: OSX version of Extrapackages folder
  • Previous by thread: Re: Why can't I call Random[NormalDistribution[10.0,0.0]]?
  • Next by thread: NDSolve and InterpolatingFunction