set.seed(17)
rX8 <- rbwheel(1000,8, fullResult = TRUE, scaleAfter=FALSE)
with(rX8, stopifnot(all.equal(X, X0 %*% A, tol = 1e-15),
all.equal(X0, X %*% t(A), tol = 1e-15)))
##--> here, don't need to keep X0 (nor A, since that is Qrot(p))
## for n = 100, you don't see "it", but may guess .. :
n <- 100
pairs(r <- rbwheel(n,6))
n1 <- attr(r,"n1") ; pairs(r, col=1+((1:n) > n1))
## for n = 500, you *do* see it :
n <- 500
pairs(r <- rbwheel(n,6))
## show explicitly
n1 <- attr(r,"n1") ; pairs(r, col=1+((1:n) > n1))
## but increasing sig2 does help:
pairs(r <- rbwheel(n,6, sig2 = .2))
## show explicitly
n1 <- attr(r,"n1") ; pairs(r, col=1+((1:n) > n1))
set.seed(12)
pairs(X <- rbwheel(n, 7, spherize=TRUE))
colSums(X) # already centered
if(require("ICS") && require("robustbase")) {
# ICS: Compare M-estimate [Max.Lik. of t_{df = 2}] with high-breakdown :
stopifnot(require("MASS"))
X.paM <- ics(X, S1 = cov, S2 = function(.) cov.trob(., nu=2)$cov, stdKurt = FALSE)
X.paM.<- ics(X, S1 = cov, S2 = function(.) tM(., df=2)$V, stdKurt = FALSE)
X.paR <- ics(X, S1 = cov, S2 = function(.) covMcd(.)$cov, stdKurt = FALSE)
plot(X.paM) # not at all clear
plot(X.paM.)# ditto
plot(X.paR)# very clear
}
## Similar such experiments ---> demo(rbwheel_d) and demo(rbwheel_ics)
## -------------- -----------------
Run the code above in your browser using DataLab