I found the following strange behavior using qnorm() and pnorm():> x<-8.21;x-qnorm(pnorm(x))[1] 0.0004638484> x<-8.22;x-qnorm(pnorm(x))[1] 0.01046385> x<-8.23;x-qnorm(pnorm(x))[1] 0.02046385> x<-8.24;x-qnorm(pnorm(x))[1] 0.03046385> x<-8.25;x-qnorm(pnorm(x))[1] 0.04046385> x<-8.26;x-qnorm(pnorm(x))[1] 0.05046385> x<-8.27;x-qnorm(pnorm(x))[1] 0.06046385> x<-8.28;x-qnorm(pnorm(x))[1] 0.07046385> x<-8.29;x-qnorm(pnorm(x))[1] 0.08046385> x<-8.30;x-qnorm(pnorm(x))[1] -Inf Given that pnorm(8.30) delivers 1 shouldn't we get Inf for x<-8.30;x-qnorm(pnorm(x)) ? Thanks in advance. Dietrich Trenkler -- Dietrich Trenkler Universit??t Osnabr??ck FB Wirtschaftswissenschaften Rolandstr.8 D-49069 Osnabr??ck dtrenkler at nts6.oec.uni-osnabrueck.de
> -----Original Message----- > From: Trenkler, Dietrich > Sent: Friday, August 06, 2004 3:13 PM > To: 'r-help' > Subject: [R] Bug in qnorm or pnorm? > > I found the following strange behavior using qnorm() and pnorm(): > > > x<-8.21;x-qnorm(pnorm(x)) > [1] 0.0004638484 > > x<-8.22;x-qnorm(pnorm(x)) > [1] 0.01046385 > > x<-8.23;x-qnorm(pnorm(x)) > [1] 0.02046385 > > x<-8.24;x-qnorm(pnorm(x)) > [1] 0.03046385 > > x<-8.25;x-qnorm(pnorm(x)) > [1] 0.04046385 > > x<-8.26;x-qnorm(pnorm(x)) > [1] 0.05046385 > > x<-8.27;x-qnorm(pnorm(x)) > [1] 0.06046385 > > x<-8.28;x-qnorm(pnorm(x)) > [1] 0.07046385 > > x<-8.29;x-qnorm(pnorm(x)) > [1] 0.08046385 > > x<-8.30;x-qnorm(pnorm(x)) > [1] -Inf > > > Given that pnorm(8.30) delivers 1 shouldn't we get Inf > for x<-8.30;x-qnorm(pnorm(x)) ? > > Thanks in advance. >[Dietrich Trenkler] Oops, forgot to mention: > unlist(R.Version()) platform arch os system "i386-pc-mingw32" "i386" "mingw32" "i386, mingw32" status major minor year "" "1" "9.1" "2004" month day language "06" "21" "R" D. Trenkler
On Friday 06 August 2004 08:13, Trenkler, Dietrich wrote:> Given that pnorm(8.30) delivers 1 shouldn't we get Inf > for x<-8.30;x-qnorm(pnorm(x)) ?Why?> pnorm(8.30)[1] 1> qnorm(pnorm(8.30)) ## same as qnorm(1)[1] Inf> 8.30 - qnorm(pnorm(8.30)) ## same as 8.30 - Inf[1] -Inf This seems perfectly acceptable to me for all reasonable definitions of Inf. Deepayan
> -----Original Message----- > From: Deepayan Sarkar > Sent: Friday, August 06, 2004 3:31 PM > To: r-help at stat.math.ethz.ch > Subject: Re: [R] Bug in qnorm or pnorm? > > On Friday 06 August 2004 08:13, Trenkler, Dietrich wrote: > > > Given that pnorm(8.30) delivers 1 shouldn't we get Inf > > for x<-8.30;x-qnorm(pnorm(x)) ? > > Why? > > > pnorm(8.30) > [1] 1 > > qnorm(pnorm(8.30)) ## same as qnorm(1) > [1] Inf > > 8.30 - qnorm(pnorm(8.30)) ## same as 8.30 - Inf > [1] -Inf > > This seems perfectly acceptable to me for all reasonable definitions of > Inf. > > Deepayan > >[Dietrich Trenkler] Yes of course, you're right. I meant qnorm(pnorm(8.3)) should deliver Inf -- as it does. Thank you. Dietrich.