R/LLsharpen.R

Defines functions LLsharpen

Documented in LLsharpen

LLsharpen <- function(x, y, h) {
    ysharp <- y
    for (j in 1:length(x)) {
        y.lm <- lm(y ~ I(x-x[j]), weights=dnorm(x-x[j], sd = h))
        ysharp[j] <- 2*y[j] - coef(y.lm)[1]
    }
    ysharp
}

Try the sharpData package in your browser

Any scripts or data that you put into this service are public.

sharpData documentation built on March 30, 2021, 9:06 a.m.