1 |
x |
|
y |
|
fr |
|
varfun |
|
est |
|
xout |
|
outfun |
|
eout |
|
corfun |
|
... |
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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | ##---- 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, y, fr = NA, varfun = pbvar, est = tmean, xout = FALSE,
outfun = out, eout = FALSE, corfun = pbvar, ...)
{
m = elimna(cbind(x, y))
if (eout) {
flag <- outfun(m, plotit = FALSE)$keep
m = m[flag, ]
}
x = as.matrix(x)
p = ncol(x)
p1 = p + 1
x = as.matrix(m[, 1:p])
y = m[, p1]
vals = NA
if (is.na(fr)) {
if (p == 1)
fr = 0.8
if (p > 1)
fr = 1
}
if (xout) {
keepit <- outfun(x, plotit = FALSE, ...)$keep
x <- x[keepit, ]
y <- y[keepit]
}
x = as.matrix(x)
for (i in 1:nrow(x)) {
if (p == 1)
vals[i] = runhat(x[-i, ], y[-i], fr = fr, est = est,
pts = x[i, ], ...)
if (p > 1)
vals[i] = rung3hat(x[-i, ], y[-i], fr = fr, pts = t(as.matrix(x[i,
])))$rmd
}
dif = y - vals
ans = varfun(elimna(dif))
list(VAR.Y.HAT = ans)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.