plogis bug
Goran Brostrom
gb@stat.umu.se
Sun, 5 Apr 1998 19:14:05 +0200 (MET DST)
On Sun, 5 Apr 1998, Bill Simpson wrote:
> plogis seems broken:
>
> > xfit<-seq(1,5,.1)
> > pfit<-pnorm(-(3-xfit)/1)
> > pfit
> [1] 0.02275013 0.02871656 0.03593032 0.04456546 0.05479929 0.06680720
> [7] 0.08075666 0.09680048 0.11506967 0.13566606 0.15865525 0.18406013
> [13] 0.21185540 0.24196365 0.27425312 0.30853754 0.34457826 0.38208858
> [19] 0.42074029 0.46017216 0.50000000 0.53982784 0.57925971 0.61791142
> [25] 0.65542174 0.69146246 0.72574688 0.75803635 0.78814460 0.81593987
> [31] 0.84134475 0.86433394 0.88493033 0.90319952 0.91924334 0.93319280
> [37] 0.94520071 0.95543454 0.96406968 0.97128344 0.97724987
> > pfit<-plogis(-(3-xfit)/1)
> > pfit
> [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
> [8] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
> [15] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.5000000
> [22] 0.5249792 0.5498340 0.5744425 0.5986877 0.6224593 0.6456563 0.6681878
> [29] 0.6899745 0.7109495 0.7310586 0.7502601 0.7685248 0.7858350 0.8021839
> [36] 0.8175745 0.8320184 0.8455347 0.8581489 0.8698915 0.8807971
> notice all the zeros--this is wrong.
>
> I actually looked at plogis.c and it looks fine. Not sure what is causing
> the trouble.
I also looked at plogis.c. It looks fine in R-0.61.1, but not in
R-snapshot; the difference is an added line
if(x < location) return 0;
which should not be there. Guess you are running snapshot and looking at
plogis.c form another version.
Goran Brostrom
Statistics Dept, Umea University
Umea, Sweden
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._