[R] Factorial, L-moments, and overflows

Pedro.Rodriguez at sungard.com Pedro.Rodriguez at sungard.com
Sun Sep 16 17:18:42 CEST 2007


Hi everyone,

In the package POT, there is a function that computes the L-moments of a given sample (samlmu). However, to compute those L-moments, one needs to obtain the total number of combinations between two numbers, which, by the way, requires the use of a factorial. See, for example, Hosking (1990 , p. 113).

How does the function "samlmu" in the package POT avoids overflows?

I was trying to build from scratch a R function similar to "samlmu" and ran into overflows (Just for my educational purposes :o) ). Is there a trick that I am missing to avoid overflows in the factorial function? 

Thank you very much for your time. 

Pedro N. Rodriguez
SSRN Homepage: http://ssrn.com/author=412141/ 
Homepage: http://www.pnrodriguez.com/



More information about the R-help mailing list