You know how to compute the probability 

   (r,p)NB y

that the negatively binomially distributed variable assumes the nonnegative 
integer value  y , then compute the probability that it is less than or equal 
to, say, i.100

   n=:+/\(r,p)NB i.100

A random number between 0 and 1

   ?0

is greater than this number of these probabilities


   +/n<?0

so this computes a negatively binomially distributed random variable. 

OK?
Thanks. Bo.

Den 21:04 fredag den 4. april 2014 skrev Devon McCormick <devon...@gmail.com>:
 
I'd like to encourage J versions of things like this but I don't think R
>requires admin rights to install.
>
>
>On Fri, Apr 4, 2014 at 2:57 PM, John Baker <bakerj...@gmail.com> wrote:
>
>> Thanks guys,
>>
>> Unfortunately I need the nonintegral version which I believe is a ratio of
>> gamma funcions - I'll have to look it up.
>>
>> The R route is not viable for me unless R can be installed without admin
>> rights. The last time I looked one of the R interfaces was COM based which
>> requires registry entries. It's easier for me to write my own that go
>> through all the bullshit required to install software on company machines.
>>
>> One of the pleasing reactions of the ever increasing levels of corporate
>> software management paranoia is the development of install packages that no
>> longer require elevated rights.  J is a good example. With the exception of
>> the COM server J can be dropped anywhere without filling out SOX forms.
>>
>> "The more you tighten your grip, Tarkin, the more star systems will slip
>> through your ... spam filters"
>>
>>
>>
>> On Fri, Apr 4, 2014 at 12:32 PM, Brian Schott <schott.br...@gmail.com
>> >wrote:
>>
>> > Do you only need integer values for the one parameter?
>> > If so, there is a half page, 7 step, algorithm in my old copy of
>> Fishman's
>> > simulation text I can photocopy for you. He has two other algorithm that
>> > require more complex computations such as Cauchy and Gamma and Poisson
>> > variates.
>> >
>> >
>> >
>> >
>> > --
>> > (B=) <-----my sig
>> > Brian Schott
>> > ----------------------------------------------------------------------
>> > For information about J forums see http://www.jsoftware.com/forums.htm
>> >
>>
>>
>>
>> --
>> John D. Baker
>> bakerj...@gmail.com
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
>
>
>-- 
>Devon McCormick, CFA
>
>----------------------------------------------------------------------
>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