[R] how to use R for Beta Negative Binomial

Duncan Murdoch murdoch at stats.uwo.ca
Mon Jan 7 12:26:34 CET 2008


Nasser Abbasi wrote:
> "Duncan Murdoch" <murdoch at stats.uwo.ca> wrote in message 
> news:4780ED3B.8020202 at stats.uwo.ca...
>
>
>   
>> Why did you change the parameters?  If you used the same ones as above,
>> you get
>>
>>     
>>> sghyper(a=-1, k=-1, N=5)
>>>       
>> $title
>> [1] "Generalized Hypergeometric"
>>
>>     
>
>   
>> $Mean
>> [1] 0.2
>>
>>     
> .....
>   
>> I don't know if those values are correct, but at least they aren't
>> nonsensical like the ones you report from Mathematica.
>>
>> Duncan Murdoch
>>
>>     
>
> But the thing I do not understand is which is ALPHA, which is BETA and which 
> is N?
>
> Could I please ask you show the R command to generate this plot  from NIST 
> web site (the second one in the first row)?
>
> http://www.itl.nist.gov/div898/software/dataplot/refman2/auxillar/gif/bnbpdf.gif
>
> I can produce the plot using Mathematica command. For example, looking at 
> the plot for ALPHA=3, BETA=0.5, k=3, (again, the second plot in the first 
> row), the following is the command in Mathematica to get the same plot:
>
> http://12000.org/tmp/010608/beta1.PNG
>
> I tried this in R, but I really do not know to tell this command in R which 
> is alpha, which is beta and which is k?
>   
I don't know.  This is a common problem with special functions:  they 
are invented more than once with different parametrizations, and it's 
tricky to recognize how they are related.  You'll need to go to the 
referenced literature, or some other reference such as Johnson and Kotz.

Duncan Murdoch




More information about the R-help mailing list