[Rd] lowess output looks wrong (PR#7891)
murdoch@stats.uwo.ca
murdoch at stats.uwo.ca
Tue Jul 5 19:22:17 CEST 2005
Just noticed nobody has commented on this, so I took a look, and I can't
see the problem (2.1.0 looks the same as 2.1.1 to me). What is supposed
to be wrong?
Duncan Murdoch
On 5/23/2005 2:35 PM, pelzc at ohsu.edu wrote:
> Full_Name: Carl Pelz
> Version: 2.1.0 & 2.0.1
> OS: Windows 2000
> Submission from: (NULL) (137.53.64.158)
>
>
> # Paste this all into an R session for a graphical demonstration of BUG...
> # Ive found a bug in lowess in R versions 2.0.1 & 2.1.0 (Windows binary
> versions).
> # Running on Windows 2000 system.
> # Someone noticed a similar problem and reported it under ID 4459.
>
> # Data to reproduce...
> R <- c(3.0, 3.5, 4.5, 5.0, 10.0)
> T <- R
> T <- 1.5*T + 0.1*(T^2)
>
> # Bug in lowess (third y value is wrong in lowess output)...
> xin <- log2(R)
> yin <- log2(T)
> minVal <- min (xin, yin)
> maxVal <- max (xin, yin)
> plot (xin, yin, xlim=c(minVal, maxVal), ylim=c(minVal, maxVal))
> lines (lowess(xin, yin, f = 2/3, iter = 3))
> text(3.5, 2, "3rd lowess point is wrong.", col="red")
> text(3.5, 1.75, "Click for next graph.", col="red")
> locator (n=1, type="n")
>
> # lowess OK...
> xin <- log2(R)
> yin <- log2(T)
> minVal <- min (xin, yin)
> maxVal <- max (xin, yin)
> plot (xin, yin, xlim=c(minVal, maxVal), ylim=c(minVal, maxVal))
> # f = 1/2
> lines (lowess(xin, yin, f = 1/2, iter = 3))
> text(3.5, 2, "OK with f = 1/2.", col="red")
> text(3.5, 1.75, "Click for next graph.", col="red")
> locator (n=1, type="n")
>
> # lowess OK...
> xin <- log2(R)
> yin <- log2(T)
> minVal <- min (xin, yin)
> maxVal <- max (xin, yin)
> plot (xin, yin, xlim=c(minVal, maxVal), ylim=c(minVal, maxVal))
> # iter = 0
> lines (lowess(xin, yin, f = 2/3, iter = 0))
> text(3.5, 2, "OK with iter = 0.", col="red")
> text(3.5, 1.75, "Click for next graph.", col="red")
> locator (n=1, type="n")
>
> # Bug in lowess (forth y value is wrong in lowess output)...
> xin <- log2(R)
> yin <- log2(T)
> # Change xin[3]
> xin[3] <- 2.2
> minVal <- min (xin, yin)
> maxVal <- max (xin, yin)
> plot (xin, yin, xlim=c(minVal, maxVal), ylim=c(minVal, maxVal))
> lines (lowess(xin, yin, f = 2/3, iter = 3))
> text(3.5, 2, "4th lowess point is wrong.", col="red")
> text(3.5, 1.75, "Done.", col="red")
>
> ______________________________________________
> R-devel at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
More information about the R-devel
mailing list