I aim to use maximum likelihood methods (usually about 10^5 iterations) with a probability distribution that creates very big integers and very small float values that cannot be stored as a numeric
nor a in a float
type.
I thought I would use the as.bigq
in the gmp
package. My issue is that one can only add, substract, multiply and dived two objects of class/type bigq
, while my distribution actually contains logarithm, power, gamma and confluent hypergeometric functions.
What is my best option to deal with this issue?
bigq
objects.
+,-,*,/
operators? Should I approximate this function using a taylor series expansion?+,-,*,/
operators when the exponent is not an integer?Hypergeometric1F1Regularized[..]
function in Mathematica
)?I could eventually write these functions in C
and call them from R
but it sounds like some complicated work for not much, especially if I have to use the gmp
package in C as well to handle these big numbers.
All your problems can be solved with Rmpfr
most likely which allows you to use all of the functions returned by getGroupMembers("Math")
with arbitrary accuracy.
Vignette: http://cran.r-project.org/web/packages/Rmpfr/vignettes/Rmpfr-pkg.pdf
Simple example of what it can do:
test <- mpfr(rnorm(100,mean=0,sd=.0001), 240)
Reduce("*", test)
I don't THINK it has hypergeometric functions though...