1 | rrplot(x, y, nsamps = 7)
|
x |
|
y |
|
nsamps |
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, y, nsamps = 7)
{
n <- length(y)
rmat <- matrix(nrow = n, ncol = 5)
lsres <- lsfit(x, y)$residuals
print("got OLS")
l1res <- l1fit(x, y)$residuals
print("got L1")
almsres <- lmsreg(x, y)$resid
print("got ALMS")
altsres <- ltsreg(x, y)$residuals
print("got ALTS")
out <- mba$coef
mbacoef <- mbareg(x, y, nsamp = nsamps)$coef
MBARES <- y - mbacoef[1] - x %*% mbacoef[-1]
print("got MBA")
rmat[, 1] <- lsres
rmat[, 2] <- l1res
rmat[, 3] <- almsres
rmat[, 4] <- altsres
rmat[, 5] <- MBARES
pairs(rmat, labels = c("OLS residuals", "L1 residuals", "ALMS residuals",
"ALTS residuals", "MBA residuals"))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.