The function serves as wrapper for loess
and lets one make 2D or 3D smoother plots using loess
specifications.
loess.surf(Y, X, span = 0.75, degree = 1, family = "gaussian", phi = 20,
theta = 50, xlab = "X", ylab = "Y", zlab = "Fit", line.col = 1,
line.type = 1, scale = TRUE, duplicate = "error", expand = 0.5, ...)
A numeric response vector.
A numeric explanatory vector or a two column matrix for 3D smooths.
Span parameter, i.e. the size of the local neighborhood.
Indicates whether linear degree = 1
or quadratic models degree = 2
are to be applied to each local neighborhood.
Type of error distribution to be optimized in fitting. The default, "gaussian"
is fitting with least squares. Fitting with Tukey's biweight M-Estimator is used if family = "symmetric"
.
Parameter from persp
,phi
provides the colatitude viewing angle.
Parameter from persp
theta
gives the azimuthal direction.
X-axis label.
Y-axis label.
Z-axis label
Color of loess fit line.
Line type for loess fit.
Logical from persp
If scale is TRUE
the x, y and z coordinates are transformed separately. If scale is FALSE
the coordinates are scaled so that aspect ratios are retained.
Argument from interp
from library akima
. Consists of a character string indicating how to handle duplicate data points. The default, duplicate = "error"
produces an error message.
Argument from persp
, a expansion factor applied to the z coordinates.
Additional arguments from plot
Output is a 2D or 3D smooth plot.
Wilcox, R. R. (2005) Introduction to Robust Estimation and Hypothesis Testing, Second Edition. Elsevier, Burlington, MA.
# NOT RUN {
X1<-sort(rnorm(100))
X2<-rexp(100)
Y<-rgamma(100,1,2)
loess.surf(Y,cbind(X1,X2))
# }
Run the code above in your browser using DataLab