Message-ID: <SN6PR10MB2432033BB15E0E49704F40B39F780@SN6PR10MB2432.namprd10.prod.outlook.com>
Date: 2020-07-21T21:01:42Z
From: Wang, Zhu
Subject: [R-pkg-devel] [External] Re: incomplete gamma function Fortran subroutine
In-Reply-To: <59889da2-0e8a-fcd1-d3b5-fe1dd2130962@gmail.com>
Indeed, that is the piece I missed completely! Glad that I didn't try to invent wheels.
Thanks,
Zhu
-----Original Message-----
From: Ben Bolker <bbolker at gmail.com>
Sent: Tuesday, July 21, 2020 3:58 PM
To: luke-tierney at uiowa.edu; Wang, Zhu <wangz1 at uthscsa.edu>
Cc: John P. Nolan <jpnolan at american.edu>; r-package-devel at r-project.org
Subject: Re: [External] Re: [R-pkg-devel] incomplete gamma function Fortran subroutine
? Interesting.? It looks like the way to make use of this is to combine the information in section 6.7.1 ("Distribution functions", including pgamma ...) with section 6.6 "Calling C from Fortran and vice versa" ?
On 7/21/20 4:33 PM, luke-tierney at uiowa.edu wrote:
> Looking at this section of WRE may help:
>
> https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Numerical
> -analysis-subroutines
>
>
> Best,
>
> luke
>
> On Tue, 21 Jul 2020, Wang, Zhu wrote:
>
>> Thanks to Ben and John. Perhaps the program should call pgamma in R
>> and pass the number to Fortran. Calling some Fortran subroutines
>> older than R can trigger concerns when submitting the package to the
>> CRAN.
>>
>> Best,
>> Zhu
>>
>> -----Original Message-----
>> From: John P. Nolan <jpnolan at american.edu>
>> Sent: Tuesday, July 21, 2020 1:43 PM
>> To: Wang, Zhu <wangz1 at uthscsa.edu>; Ben Bolker <bbolker at gmail.com>;
>> r-package-devel at r-project.org
>> Subject: RE: [R-pkg-devel] incomplete gamma function Fortran
>> subroutine
>>
>> As others have said, built-in function pgamma is a (normalized)
>> version of the incomplete gamma function!?? John
>>
>> -----Original Message-----
>> From: R-package-devel <r-package-devel-bounces at r-project.org> On
>> Behalf Of Wang, Zhu
>> Sent: Tuesday, July 21, 2020 2:16 PM
>> To: Ben Bolker <bbolker at gmail.com>; r-package-devel at r-project.org
>> Subject: Re: [R-pkg-devel] incomplete gamma function Fortran
>> subroutine
>>
>> External Email: Use caution with links and attachments.
>>
>> Sorry for not making myself clear: The Fortran subroutine in an R
>> package needs to call incomplete gamma function.
>>
>> -----Original Message-----
>> From: R-package-devel <r-package-devel-bounces at r-project.org> On
>> Behalf Of Ben Bolker
>> Sent: Tuesday, July 21, 2020 12:54 PM
>> To: r-package-devel at r-project.org
>> Subject: Re: [R-pkg-devel] incomplete gamma function Fortran
>> subroutine
>>
>> ??? Is there a reason not to use pgamma(), possibly adjusted by a
>> (de-)normalizing constant??? (See detailed notes in ?pgamma)
>>
>> On 7/21/20 1:44 PM, Wang, Zhu wrote:
>>> Hello,
>>>
>>> In an R function within a package, I would like to call a Fortran
>>> subroutine to compute lower gamma function. Any advice will be
>>> appreciated.
>>>
>>> Thanks!
>>>
>>> Zhu Wang
>>>
>>> ????? [[alternative HTML version deleted]]
>>>
>>> ______________________________________________
>>> R-package-devel at r-project.org mailing list
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_ma
>>> il
>>> man_listinfo_r-2Dpackage-2Ddevel&d=DwIGaQ&c=U0G0XJAMhEk_X0GAGzCL7Q&r
>>> =7
>>> rQvU8hscCTWlvO-F5wI2-2eTiW40XI5qUKda0AnbG0&m=Y5sTjoEyQhEnvYqP-rmi1Pm
>>> vi
>>> Z_5jj7ur9P8ujvLiBc&s=w0p6b_yBQ1jDH3amMKQGvmEKYJD-BAid_CphFO37yu0&e=
>>
>> ______________________________________________
>> R-package-devel at r-project.org mailing list
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mai
>> lman_listinfo_r-2Dpackage-2Ddevel&d=DwIGaQ&c=U0G0XJAMhEk_X0GAGzCL7Q&r
>> =7rQvU8hscCTWlvO-F5wI2-2eTiW40XI5qUKda0AnbG0&m=Y5sTjoEyQhEnvYqP-rmi1P
>> mviZ_5jj7ur9P8ujvLiBc&s=w0p6b_yBQ1jDH3amMKQGvmEKYJD-BAid_CphFO37yu0&e
>> = ______________________________________________
>> R-package-devel at r-project.org mailing list
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mai
>> lman_listinfo_r-2Dpackage-2Ddevel&d=DwIGaQ&c=U0G0XJAMhEk_X0GAGzCL7Q&r
>> =7rQvU8hscCTWlvO-F5wI2-2eTiW40XI5qUKda0AnbG0&m=Y5sTjoEyQhEnvYqP-rmi1P
>> mviZ_5jj7ur9P8ujvLiBc&s=w0p6b_yBQ1jDH3amMKQGvmEKYJD-BAid_CphFO37yu0&e
>> = ______________________________________________
>> R-package-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>>
>