
Dear all, A first version for MonetDB-rmath is now available. It includes approximately 90% of the functions in Rmath.h, including [rpdq](norm|unif|gamma|beta|lnorm|chisq|nchisq|f|t|binom|cauchy|exp|geom|hyper| nbinom|pois|weibull|logis|wilcox|signrank) and another 40 functions. The current implementation uses m4 for code generation and requires the r-mathlib package under Debian. One can clone the GitHub repository and install using: git clone https://github.com/mclements/MonetDB-rmath.git cd MonetDB-rmath make sudo make install You will then need to use a fresh database. An example script is: -- calculate the quantile and cumulative distribution function for a unit normal select qnorm(0.025,0,1), pnorm(-1.96,0,1); -- calculate E(Z^2) for Z~Normal(0,1) select sum(R_pow(value,2)*0.01*dnorm(value,0,1)) from sys.generate_series(-5.0,5.0,0.01); -- random numbers select set_seed(1,2); select rpois(value*0+100) from sys.generate_series(1,10); -- ok select rpois(100) from sys.generate_series(1,10); -- repeats the values 10 times:-< All of the functions are currently scalars. Next steps include adding BAT functions, including some of the constants at the beginning of Rmath.h, and adding some statistical tests. As an example, I have included poissonci(y,boundary) for an exact Poisson confidence interval for count y for a specific boundary (1=left, 2=right) with default confidence level of 95%: select poissonci(10,1), poissonci(10,2); The equivalent code in R would be poisson.test(10). For confidence intervals, it would be nice to have a type that is a pair of doubles. Sincerely, Mark.