[R] Hypergeometric Function seems to give wrong results

Ben Bolker bbolker at gmail.com
Wed Jul 8 16:18:28 CEST 2015


Carlos Nasher via R-help <r-help <at> r-project.org> writes:

>

[snip]

> I need to evaluate the Hypergeometric Function of the 2nd kind (Tricomi
> confluent hypergeometric function). Therefore I'm using the kummerU
> function from the fAsianOptions package. It seems to me that kummerU is
> giving wrong results. Here's an example:
> 
> library("fAsianOptions")
> kummerU(a=19, b=19, x = 10)
> 
> R gives 1838.298 for the real part.
> 
> If I use Mathematica via the wolfram site (
> http://functions.wolfram.com/webMathematica
   /FunctionEvaluation.jsp?name=HypergeometricU)
> the result is 3.52603e-20 which is more reasonable in the context of my
> analysis.
> 

 [snip]

  Your best bet is probably to contact the package maintainer
(use maintainer("fAsianOptions") to see who it is, or look on 
the CRAN page for the package).  If this functionality is very
commonly used in finance you might try the r-sig-finance mailing
list (indicating that you've already tried here).

  good luck
    Ben Bolker



More information about the R-help mailing list