do3Scale function

Centering and scaling

Centering and scaling

Centering and/or normalization of a three way array or a matricized array across one mode (modes indicated by "A", "B" or "C").

## S3 method for class 'tucker3' do3Scale(x, renorm.mode = c("A", "B", "C"), ...) ## S3 method for class 'parafac' do3Scale(x, renorm.mode = c("A", "B", "C"), ...) ## Default S3 method: do3Scale(x, center = FALSE, scale = FALSE, center.mode = c("A", "B", "C", "AB", "AC", "BC", "ABC"), scale.mode = c("B", "A", "C"), only.data=TRUE, ...)

Arguments

  • x: Three dimensional array of order (I x J x K) or a matrix (or data.frame coerced to a matrix) of order (I x JK) containing the matricized array (frontal slices)
  • center: Whether and how to center the data. Can be NULL, logical TRUE or FALSE, function or a numeric vector with length corresponding to the number of columns in the corresponding mode. If center=TRUE, mean() is used; default is center=FALSE.
  • scale: Whether and how to scale the data. Can be NULL, logical TRUE or FALSE, function or a numeric vector with length corresponding to the number of columns in the corresponding mode. If scale=TRUE, sd() is used; default is scale=FALSE.
  • center.mode: Across which mode to center. Default is center.mode="A"
  • scale.mode: Within which mode to scale. Default is scale.mode="B"
  • renorm.mode: Within which mode to renormalize a Parafac or Tucker3 solution. See in Details how this is performed for the different models. Default is renorm.mode="A"
  • only.data: Whether to return only the centered/scaled data or also the center and the scale themselves. Default is only.data=TRUE
  • ...: potential further arguments passed to lower level functions.

Returns

A named list, consisting of the centered and/or scaled data, a center vector, a scale vector and the mode in which the data were centered/scaled.

References

Kiers, H.A.L. (2000).Towards a standardizrd notation and terminology in multiway analysis. Journal of Chemometrics, 14:105-122.

Kroonenberg, P.M. (1983).Three-mode principal component analysis: Theory and applications (Vol. 2), DSWO press.

Author(s)

Valentin Todorov valentin.todorov@chello.at and Maria Anna Di Palma madipalma@unior.it and Michele Gallo mgallo@unior.it

Examples

data(elind) (x1 <- do3Scale(elind, center=TRUE, scale=TRUE)) (x2 <- do3Scale(elind, center=TRUE, scale=TRUE, center.mode="B")) (x3 <- do3Scale(elind, center=TRUE, scale=TRUE, center.mode="C", scale.mode="C"))
  • Maintainer: Valentin Todorov
  • License: GPL (>= 3)
  • Last published: 2024-02-06