smooth.spline
SmoothSpline(x, ...)
## S3 method for class 'default':
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), ...)
## S3 method for class 'formula':
SmoothSpline(formula, data, subset, na.action, \dots)
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
TRUE
) or 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
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
$n_x > 49$ thiTRUE
(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
withx
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.spline
plot(temperature ~ delivery_min, data=d.pizza)
lines(SmoothSpline(temperature ~ delivery_min, data=d.pizza))
Run the code above in your browser using DataCamp Workspace