> How do you generate normally distributed random numbers? ...

Here's what I use.
   normalrand =: [: +/ [: (? - ?) 0 $~ 6 , ]
   R =: normalrand 100     NB. 100-vec of Gaussian noise: mean 0, sd 1

Note that ?0 has variance %12. So +/(?-?)6$0 has mean zero and variance one, 
and is practically normally distributed. (The probability that a standard 
normal variable U satisfies U>12 is small).

- Bo


>________________________________
> Fra: Ian Clark <[email protected]>
>Til: [email protected] 
>Sendt: 0:55 torsdag den 9. august 2012
>Emne: Re: [Jprogramming] Miscellaneous J Questions
> 
>> How do you generate normally distributed random numbers? ...
>
>Here's what I use.
>
>require 'stats/base/random'
>R=: normalrand 100     NB. 100-vec of Gaussian noise: mean 0, sd 1
>
>> Also, does anyone know how to make the J dictionary work on a mac? My 
>> computer opens it with gedit for some reason and won't compile it.
>
>Don't understand this...
>
>When I choose Help > Dictionary in j602 on my iMac, the browser
>launches and shows:
>file:///Applications/j602/help/dictionary/contents.htm
>
>Have you got some preferred editor setup in your default browser?
>
>Why not use the web version for now (I do all the time):
>http://www.jsoftware.com/help/dictionary/contents.htm
>
>On Wed, Aug 8, 2012 at 11:37 PM, Owen Marschall
><[email protected]> wrote:
>> Hi everyone,
>>
>> Quick question:
>> How do you generate normally distributed random numbers? I remember one of 
>> the labs showed me how, but I've tried every possible combination of 
>> abbreviations of "normal" and "random," yet nothing's working. I'm guessing 
>> the lab must have loaded some package I forgot about. What package is this? 
>> I've looked through the labs and can't find it.
>>
>> Also, does anyone know how to make the J dictionary work on a mac? My 
>> computer opens it with gedit for some reason and won't compile it.
>>
>> Thanks,
>> Owen
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>----------------------------------------------------------------------
>For information about J forums see http://www.jsoftware.com/forums.htm
>
>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to