What packages and functions in R can perform a two dimensional non-additive local regression/smooth. For example consider
b<-seq(-6*pi,6*pi,length=100)
xy<-expand.grid(b,b)
x=xy[[1]]
y=xy[[2]]
z= sin(x)+cos(y) + 2*sin(x)*cos(y)
contour(b,b,matrix(z,100,100))
What functions could estimate this?
you can do this with loess:
fit <- loess( z ~ x+ y, span=0.01 )
dev.new()
contour( b, b, matrix( predict(fit), 100, 100 ) )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With