Carlos Nasher
2015-Jul-06 10:03 UTC
[R] Hypergeometric Function seems to give wrong results
Hello R helpers, 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. Can anyone help how to compute the correct values within R? Best regards, Carlos [[alternative HTML version deleted]]
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