1 |
y |
|
est |
|
error |
|
nboot |
|
SEED |
|
pr |
|
mval |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ##---- 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 (y, est = mean, error = sqfun, nboot = 100, SEED = TRUE,
pr = TRUE, mval = round(5 * log(length(y))))
{
if (SEED)
set.seed(2)
data <- matrix(sample(length(y), size = mval * nboot, replace = TRUE),
nrow = nboot)
bid <- apply(data, 1, idb, length(y))
yhat <- apply(data, 1, locpres1, y, est = est)
yhat <- matrix(yhat, nrow = length(y), ncol = nboot)
bi <- apply(bid, 1, sum)
temp <- (bid * (yhat - y))
diff <- apply(temp, 1, error)
ep0 <- sum(diff/bi)/length(y)
aperror <- error(y - est(y))/length(y)
val <- 0.368 * aperror + 0.632 * ep0
val
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.