0
R> x=seq(from=0, to=pi, length.out=1000)
R> y=sin(x)
R> fit=loess(y~x)
R> predict(fit, data.frame(x=-10))
 1
NA

loess by default does not extrapolate beyond the input data range. How to extrapolate for the prediction?

user1424739
  • 11,937
  • 17
  • 63
  • 152
  • 1
    I'm not sure that loess makes much sense for extrapolation, being essentially a form of local smoothing. It might be better to consider a parametric model, which _can_ be easily extrapolated. – njp Apr 17 '22 at 23:32
  • 1
    Adding to the comment of @njp, take a look at [extrapolating-a-lowess-model](https://stats.stackexchange.com/questions/27103/extrapolating-a-lowess-model) – G5W Apr 17 '22 at 23:33

0 Answers0