SL.npreg: Super learner wrapper for kernel regression

View source: R/sl_npreg.R

SL.npregR Documentation

Super learner wrapper for kernel regression

Description

Kernel regression based on the np package. Uses leave-one-out cross-validation to fit a kernel regression. See ?npreg for more details.

Usage

SL.npreg(Y, X, newX, family = gaussian(), obsWeights = rep(1, length(Y)),
  rangeThresh = 1e-07, ...)

Arguments

Y

A vector of outcomes.

X

A matrix or data.frame of training data predictors.

newX

A test set of predictors.

family

Not used by the function directly, but ensures compatibility with SuperLearner.

obsWeights

Not used by the function directly, but ensures compatibility with SuperLearner.

rangeThresh

If the the range of the outcomes is smaller than this number, the method returns the empirical average of the outcomes. Used for computational expediency and stability.

...

Other arguments (not currently used).

Examples

# simulate data
set.seed(1234)
n <- 100
X <- data.frame(X1 = rnorm(n))
Y <- X$X1 + rnorm(n)
# fit npreg
fit <- SL.npreg(Y = Y, X = X, newX = X)
#

benkeser/drtmle documentation built on Jan. 6, 2023, 11:40 a.m.