a vector containing values of the predictor variable. There should be at least 10 distinct
x values.
OPTIONAL ARGUMENTS:
data
an optional data frame in which to interpret the
x and
y variables.
y
a vector containing values of the response variable., of the same length as
x.
w
vector of weights for weighted smoothing, of the same length as
x and
y.
df
a number which supplies the
degrees of freedom = trace(S) rather than a smoothing parameter. Here
S is the implicit smoother matrix. If both
df and
spar are supplied,
spar is used unless it is
0, in which case
df is used.
spar
the coefficient of the integrated second squared derivative penalty function (commonly denoted by lambda) for normalized data. If
spar is
0 or missing and
df is missing, cross-validation is used to automatically select
spar. If a value of
spar greater than
0 is supplied, it is used as the smoothing parameter.
cv
indicates whether the
"ordinary" or
"generalized" cross-validation
score should be computed.
all.knots
if
FALSE, a suitable fine grid of knots is chosen,
usually less in number than the number of unique values of
x.
If
TRUE, the unique values of
x are used as knots.
df.offset
allows an offset to be added to the
df term used in the calculation of
the GCV criterion:
df=tr(S)+
df.offset.
penalty
allows the
df quantity used in GCV to be charged a
cost=penalty
per degree of freedom.
plot.curve
if
TRUE, a scatterplot with a corresponding smoothing spline is generated.
VALUE:
an object of class
smooth.spline. See the
smooth.spline help file for details.