On Tue, Apr 14, 2009 at 1:08 PM, <jimm-pa...@gmx.de> wrote: > I'm fitting a line to my dataset. Later I want to predict missing values that > exceed the [min,max] interval of my empirical data, therefore I choose > surface="direct" for extrapolation. > > l1<-loess(y1~x1,span=0.1,data.frame(x=x1,y=y1),control=loess.control(surface="direct")) > > In my application it is highly important that the fitted line intercepts at > the point of origin. Is it possible to do this in R?
Well, you could always add lots of artificial data points x=0, y=0 ..., like this: l1<-loess(y1~x1,span=0.1,data.frame(x=c(rep(0,100),x1),y=c(rep(0,100),y1)),control=loess.control(surface="direct")) which will eventually drive f(0) to near 0, but surely that will create fitting artifacts. -s ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.