data(elind)
x1 <- do3Scale(elind, center=TRUE, scale=TRUE)
(cp <- Parafac(x1, ncomp=3, const=c("orth", "none", "none")))
cp$B
cp1 <- do3Postprocess(cp, reflectB=-1) # change the sign of all components of B
cp1$B
weights(cp1)
coordinates(cp1)
coordinates(cp1, type="principal")
## Same as above - the centering and scaling is done inside the Parafac procedure
(cp1 <- Parafac(elind, ncomp=3, const=c("orth", "none", "none"),
center=TRUE, scale=TRUE))
## Robust estimation with robust scaling with median and mad
(cp1 <- Parafac(elind, ncomp=3, const=c("orth", "none", "none"),
center=median, scale=mad, robust=TRUE))
## Robust estimation with robust scaling with median and Qn (Rousseeuw and Croux, 1993)
require(robustbase)
(cp1 <- Parafac(elind, ncomp=3, const=c("orth", "none", "none"),
center=median, scale=Qn, robust=TRUE))
Run the code above in your browser using DataLab