smooth.splineSmoothSpline(x, ...)
"SmoothSpline"(x, y = NULL, w = NULL, df, spar = NULL, cv = FALSE, all.knots = FALSE, nknots = .nknots.smspl, keep.data = TRUE, df.offset = 0, penalty = 1, control.spar = list(), tol = 0.000001 * IQR(x), ...)
"SmoothSpline"(formula, data, subset, na.action, ...)y is missing or NULL, the responses
are assumed to be specified by x, with x the index
vector.x;
defaults to all 1.spar, see the details
below.TRUE) or generalized cross-validation
(GCV) when FALSE; setting it to NA skips the evaluation
of leverages and any score.TRUE, all distinct points in x are used as
knots. If FALSE (default), a subset of x[] is used,
specifically x[j] where the nknots indices are evenly
spaced in 1:n, see also the next argument nknots.function giving the number of
knots to use when all.knots = FALSE. If a function (as by
default), the number of knots is nknots(nx). By default for
$nx > 49$ this is less than $nx$, the number
of unique x values, see the Note.TRUE (as per default), fitted values and
residuals are available from the result.df.offset in the GCV criterion.spar is computed,
i.e., missing or NULL, see below.Note that this is partly experimental and may change with general spar computation improvements!
Note that spar is only searched for in the interval
$[low, high]$.
x
values. The values are binned into bins of size tol and
values which fall into the same bin are regarded as the same. Must
be strictly positive (and finite).lhs ~ rhs where lhs gives the data values and rhs the corresponding groups.getOption("na.action").smooth.spline.smooth.spline, lines.smooth.splineplot(temperature ~ delivery_min, data=d.pizza)
lines(SmoothSpline(temperature ~ delivery_min, data=d.pizza))
Run the code above in your browser using DataLab