1 | ifmest(x, bend = 1.28, op = 2)
|
x |
|
bend |
|
op |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (x, bend = 1.28, op = 2)
{
tt <- mest(x, bend)
s <- mad(x) * qnorm(0.75)
if (op == 2) {
val <- akerd(x, pts = tt, plotit = FALSE, pyhat = T)
val1 <- akerd(x, pts = tt - s, plotit = FALSE, pyhat = T)
val2 <- akerd(x, pts = tt + s, plotit = FALSE, pyhat = T)
}
if (op != 2) {
val <- kerden(x, 0, tt)
val1 <- kerden(x, 0, tt - s)
val2 <- kerden(x, 0, tt + s)
}
ifmad <- sign(abs(x - tt) - s) - (val2 - val1) * sign(x -
tt)/val
ifmad <- ifmad/(2 * 0.6745 * (val2 + val1))
y <- (x - tt)/mad(x)
n <- length(x)
b <- sum(y[abs(y) <= bend])/n
a <- hpsi(y, bend) * mad(x) - ifmad * b
ifmest <- a/(length(y[abs(y) <= bend])/n)
ifmest
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.