rrcov3way (version 0.1-18)

Tucker3: Robust Tucker3 estimator for compositional data

Description

Compute a robust Tucker3 model for compositional data

Usage

Tucker3(X, P = 2, Q = 2, R = 2, conv = 1e-06, 
    center = FALSE, center.mode = c("A", "B", "C", "AB", "AC", "BC", "ABC"), 
    scale = FALSE, scale.mode = c("B", "A", "C"), 
    robust = FALSE, coda.transform=c("none", "ilr"), 
    ncomp.rpca = 0, alpha = 0.75, 
    maxiter=100, crit=0.975, trace = FALSE)

Arguments

X

3-way array of data

P

Number of A-mode components

Q

Number of B-mode components

R

Number of C-mode components

conv

Convergence criterion, defaults to 1e-6

center

Whether to center the data

center.mode

If scaling the data, on which mode to do this

scale

Whether to scale the data

scale.mode

If centering the data, on which mode to do this

robust

Whether to apply a robust estimation

coda.transform

If the data are a composition, use an ilr transformation. Default is non-compositional data, i.e. coda.transform="none"

ncomp.rpca

Number of components for robust PCA

alpha

Measures the fraction of outliers the algorithm should resist. Allowed values are between 0.5 and 1 and the default is 0.75

maxiter

Maximal number of iterations

crit

Cut-off for identifying outliers, default crit=0.975

trace

Logical, provide trace output

Value

An object of class "tucker3" which is basically a list with components:

fit

Fit value

fp

Fit percentage

A

Orthogonal loading matrix for the A-mode

B

Orthogonal loading matrix for the B-mode

Bclr

Orthogonal loading matrix for the B-mode, clr transformed. Available only if coda.transform="ilr", otherwise NULL

C

Orthogonal loading matrix for the C-mode

GA

Core matrix, which describes the relation between A, B and C, unfolded in A-form. The largest squared elements of the core matrix indicate the most important factors in the model of X.

iter

Number of iterations

RD

Residual distances

flag

The observations whose residual distance RD is larger than cutoff.RD can be considered as outliers and receive a flag equal to zero. The regular observations receive a flag 1

Details

The function can compute four versions of the Tucker3 model:

  1. Classical Tucker3,

  2. Tucker3 for compositional data,

  3. Robust Tucker3 and

  4. Robust Tucker3 for compositional data.

This is controlled through the parameters robust=TRUE and coda.transform="ilr".

References

Tucker, L.R. (1966). Some mathematical notes on three-mode factor analysis. Psychometrika, 31: 279--311.

Egozcue J.J., Pawlowsky-Glahn, V., Mateu-Figueras G. and Barcel'o-Vidal, C. (2003). Isometric logratio transformations for compositional data analysis. Mathematical Geology, 35(3): 279--300.

Examples

Run this code
# NOT RUN {
#############
##
## Example with the UNIDO Manufacturing value added data

data(va3way)
dim(va3way)

## Treat quickly and dirty the zeros in the data set (if any)
va3way[va3way==0] <- 0.001

##
res <- Tucker3(va3way)
res
print(res$fit)
print(res$A)

## Print the core matrix
print(res$GA)

## Distance-distance plot
plot(res, which="dd", main="Distance-distance plot")

## Paired component plot, mode A
plot(res, which="comp", main="Paired component plot (mode A)")

## Paired component plot, mode B
plot(res, which="comp", mode="B", main="Paired component plot (mode B)")

## Joint biplot
plot(res, which="jbplot", main="Joint biplot")

## Trajectory
plot(res, which="tjplot", choices=c(1:4), arrows=FALSE, main="Trajectory biplot")

# }

Run the code above in your browser using DataCamp Workspace