LLmono {sharpData} | R Documentation |
Locally linear regression is applied to bivariate data. The response is ‘sharpened’ or perturbed in a way to render a monotonically increasing curve estimate.
LLmono(x, y, h, xgrid, numgrid = 401, kernel="biweight", call.plot = TRUE, ...)
x |
a vector of explanatory variable observations |
y |
binary vector of responses |
h |
bandwidth |
xgrid |
gridpoints on x-axis where estimates are taken |
numgrid |
number of equally-spaced gridpoints (if xgrid not specified) |
kernel |
character constant |
call.plot |
if TRUE (default), the data, sharpened data and estimated curve are plotted. |
... |
other arguments for plot |
Data are perturbed the smallest possible L2 distance subject to the constraint that the local linear estimate is monotonically increasing.
x |
original explanatory variable |
y |
original responses |
ysharp |
sharpened responses |
h |
bandwidth |
xgrid |
gridpoints |
ygrid |
sharpened curve estimate |
W.J.Braun
Braun, W.J. and Hall, P., Data Sharpening for Nonparametric Estimation Subject to Constraints, Journal of Computational and Graphical Statistics, 2001
gridpts <- seq(1, 10, length=101) x <- seq(1, 10, length=51) p <- exp(-1 + .2*x)/(1 + exp(-1 + .2*x)) y <- rbinom(51, 1, p) LLmono(x, y, h=0.6, xgrid=gridpts) lines(x,p) # true mean response