Bug 16675 - predict gives warnings/odd results when using a loess fit object created in 3.2.2
Summary: predict gives warnings/odd results when using a loess fit object created in 3...
Status: UNCONFIRMED
Alias: None
Product: R
Classification: Unclassified
Component: Low-level (show other bugs)
Version: R 3.2.3
Hardware: x86_64/x64/amd64 (64-bit) Windows 64-bit
: P5 normal
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2016-01-20 11:51 UTC by Niko Porjo
Modified: 2016-01-20 11:57 UTC (History)
1 user (show)

See Also:


Attachments
different loess results in R 322 and 323 (6.20 KB, application/gzip)
2016-01-20 11:51 UTC, Niko Porjo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Niko Porjo 2016-01-20 11:51:20 UTC
Created attachment 2004 [details]
different loess results in R 322 and 323

Hi

If in 3.2.2 I
x=sample(1:5000, 200)
y=sample(1:5000, 200)
z=sample(4000:6000,200)
fit <- loess(z ~ x + y, control = loess.control(surface="direct"), span = 0.75, data.frame(x = x, y = y, z = z))
predict(fit, data.frame(x=123, y=123))

works fine. Same if I do that in 3.2.3.

But if I save the fit object in 3.2.2 and load it to 3.2.3 predict gives odd values. Sometimes it gives a value and warning, sometimes 0. In 3.2.3:

> predict(fit322, data.frame(x=1234, y=1234))
       1 
5248.651 
> 
> predict(fit322, data.frame(x=1234, y=1234))
       1 
5299.036 
> predict(fit322, data.frame(x=1234, y=1234))
       1 
5049.971 
> predict(fit322, data.frame(x=1234, y=1234))
    1 
958.5 
Warning messages:
1: In predLoess(object$y, object$x, newx = if (is.null(newdata)) object$x else if (is.data.frame(newdata)) as.matrix(model.frame(delete.response(terms(object)),  :
  pseudoinverse used at 0.090196 0.077802
2: In predLoess(object$y, object$x, newx = if (is.null(newdata)) object$x else if (is.data.frame(newdata)) as.matrix(model.frame(delete.response(terms(object)),  :
  neighborhood radius 4.1836
3: In predLoess(object$y, object$x, newx = if (is.null(newdata)) object$x else if (is.data.frame(newdata)) as.matrix(model.frame(delete.response(terms(object)),  :
  reciprocal condition number  0

The object lists from loess seem to have different number of rows.

       -Niko-