cv_lo2: Cross-validating Loess curve

cv_lo2R Documentation

Cross-validating Loess curve

Description

Function provides the cross-validation error for the loess curve in a manner that is amenable to optimization of the span.

Usage

cv_lo2(
  span,
  form,
  data,
  cost = function(y, yhat) mean((y - yhat)^2, na.rm = TRUE),
  K = n,
  numiter = 100,
  which = c("corrected", "raw")
)

Arguments

span

The span of the loess smoother.

form

The formula that identifies the model

data

A data frame containing the required variables.

cost

Cost function to be passed down to loess.

K

Number of folds for the cross-validation

numiter

Number of times over which the cv error will be aggregated

which

Return raw or corrected cv error

Value

The cross-validation error from the loess curve.

Author(s)

Dave Armstrong


davidaarmstrong/damisc documentation built on Oct. 1, 2023, 3:05 p.m.