SL.npreg {drtmle} | R Documentation |
Kernel regression based on the np
package. Uses leave-one-out cross-validation to fit a kernel regression.
See ?npreg
for more details.
SL.npreg( Y, X, newX, family = gaussian(), obsWeights = rep(1, length(Y)), rangeThresh = 1e-07, ... )
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 |
obsWeights |
Not used by the function directly, but ensures
compatibility with |
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). |
# 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) #