Re: [R] how R implement qnorm()

2012-10-19 Thread Sheng Liu
Thanks, again! Sorry for my misleading expression, I only knew the value is inquired from a polynomial approximation, but I have no idea how it is done in such a great detail. It's a great lesson for people like me who want a deep understanding of the basics. Sheng On Thu, Oct 18, 2012 at 11:46

Re: [R] how R implement qnorm()

2012-10-18 Thread peter dalgaard
On Oct 19, 2012, at 06:05 , Thomas Lumley wrote: > On Fri, Oct 19, 2012 at 12:21 PM, Sheng Liu wrote: >> Thanks a lot. It's very helpful. >> I've read through the c code. Just FYI and for my completion of the >> question, I post some of my thought on it: >> To me it looks like the algorithm is a

Re: [R] how R implement qnorm()

2012-10-18 Thread Thomas Lumley
On Fri, Oct 19, 2012 at 12:21 PM, Sheng Liu wrote: > Thanks a lot. It's very helpful. > I've read through the c code. Just FYI and for my completion of the > question, I post some of my thought on it: > To me it looks like the algorithm is actually inquiring through an > approximation table (the a

Re: [R] how R implement qnorm()

2012-10-18 Thread Sheng Liu
Thanks a lot. It's very helpful. I've read through the c code. Just FYI and for my completion of the question, I post some of my thought on it: To me it looks like the algorithm is actually inquiring through an approximation table (the approximations, at least for pnom, is "derived from those in "R

Re: [R] how R implement qnorm()

2012-10-18 Thread peter dalgaard
On Oct 18, 2012, at 09:55 , Prof Brian Ripley wrote: >> R is a bit confusing as it requires inverse error function (X = >> - sqrt(2)* erf-1 (2*P)), while R doesn't have a build in one. The InvErf >> function most people use is through qnorm( InvErf=function(x) > > I think you are wrong about 'mo

Re: [R] how R implement qnorm()

2012-10-18 Thread Prof Brian Ripley
On 18/10/2012 00:16, Sheng Liu wrote: how R implement qnorm() I wonder anyone knows the mathematical process that R calculated the quantile? It's on the help page! 'For qnorm, the code is a C translation of Wichura, M. J. (1988) Algorithm AS 241: The Percentage Points of the Normal Distribu

[R] how R implement qnorm()

2012-10-17 Thread Sheng Liu
how R implement qnorm() I wonder anyone knows the mathematical process that R calculated the quantile? The reason I asked is soly by curiosity. I know the probability of a normal distribution is calculated through integrate the Gaussian function, which can be implemented easily (see code), while