Learn R Programming

lokern (version 1.1-10.1)

varNPreg: Nonparametric Variance Estimator

Description

Estimates the error variance \(\sigma^2\) nonparametrically in the model $$Y_i = m(x_i) + E_i,$$ where \(E_i \sim (0,\sigma^2)\), i.i.d.

Computes leave-one-out residuals (local linear approximation followed by reweighting) and their variance.

Usage

varNPreg(x, y)

Value

A list with components

res

numeric; residuals at x[] of length n.

snr

explained variance of the true curve

sigma2

estimation of residual variance, \(\hat\sigma^2\).

Arguments

x

abscissae values, ordered increasingly.

y

observations at y[i] at x[i].

Author

Martin Maechler

See Also

lokerns, glkerns.

Examples

Run this code
 x <- sort(runif(100))
 y <- sin(pi*x) + rnorm(100)/10
 str(ve <- varNPreg(x,y))

Run the code above in your browser using DataLab