cotucker3: Co-Tucker3 analysis of two sequences of matrices

Description Usage Arguments Details Value Examples

Description

Computes the Co-Tucker3 (Co-Inertia Analysis + Tucker3 method) analysis of two three-dimensional arrays with the same first and third dimensions. The package also contains other functions called PCA() (Principal Component Analysis) and BGA() (Between-Groups Analysis), which perform analysis of one matrix, COIA() (Co-Inertia Analysis), which performs analysis of two matrices, PTA() (Partial Triadic Analysis) and TUCKER3(), which perform analysis of a sequence of matrices, and BGCOIA() (Between-Groups Co-Inertia Analysis), STATICO() (STATIS method + Co-Inertia Analysis), COSTATIS() (Co-Inertia Analysis + STATIS method), which also perform analysis of two sequences of matrices.

Usage

 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
COTUCKER3(X, Y, p = NULL, q = NULL, r = NULL, P1 = NULL, P2 = NULL, Q1 = NULL, Q2 = NULL,
          R1 = NULL, R2 = NULL, dimAX = NULL, dimAY = NULL, dimBX = NULL, dimBY = NULL,
          dimCX = NULL, dimCY = NULL, coloresf = NULL, coloresc1 = NULL,
          coloresc2 = NULL, maximo = 5, iter = 100, tol = 10^-8, norm = FALSE,
          contr = FALSE)
PCA(X, dimX = NULL, dimY = NULL, coloresf = NULL, coloresc = NULL, norm = FALSE,
    contr = FALSE)
BGA(X, gruposf, dimX = NULL, dimY = NULL, coloresf = NULL, coloresc = NULL, norm = FALSE,
    contr = FALSE)
COIA(X, Y, dimXx = NULL, dimYx = NULL, dimXy = NULL, dimYy = NULL, dimX = NULL,
     dimY = NULL, coloresf = NULL, coloresc1 = NULL, coloresc2 = NULL, norm = FALSE,
     contr = FALSE, cotucker = FALSE, tcotucker = FALSE)
PTA(X, dimX = NULL, dimY = NULL, coloresf = NULL, coloresc = NULL, norm = FALSE,
    contr = FALSE)
STATIS(X, dimX = NULL, dimY = NULL, coloresf = NULL, norm = FALSE,
    contr = FALSE)
STATISDUAL(X, dimX = NULL, dimY = NULL, coloresc = NULL, norm = FALSE,
    contr = FALSE)
BGCOIA(X, Y, dimXx = NULL, dimYx = NULL, dimXy = NULL, dimYy = NULL, dimX = NULL,
       dimY = NULL, coloresf = NULL, coloresc1 = NULL, coloresc2 = NULL, norm = FALSE,
       contr = FALSE)
STATICO(X, Y, dimX = NULL, dimY = NULL, coloresf = NULL, coloresc1 = NULL,
        coloresc2 = NULL, norm = FALSE, contr = FALSE)
COSTATIS(X, Y, dimX = NULL, dimY = NULL, coloresf = NULL, coloresc1 = NULL,
         coloresc2 = NULL, norm = FALSE, contr = FALSE)
TUCKER3(X, p = NULL, q = NULL, r = NULL, P1 = NULL, P2 = NULL, Q1 = NULL, Q2 = NULL,
        R1 = NULL, R2 = NULL, coloresf = NULL, coloresc = NULL, maximo = 5, iter = 100,
        tol = 10^-8, norm = FALSE, contr = FALSE)

# Auxiliary functions for the previous ones:

read(X, Y = NULL)
colores(filas, columnas, coloresf, coloresc, conf, columnas2 = NULL, coloresc2 = NULL)
preproc(X, norm, cubo = FALSE, capas = FALSE)
pesos(t)
contributions(M, names, title, first = FALSE)
contributions2(M, dimension)
screeplot(d)
compr(dimX, dimY, d, c = NULL, tucker = FALSE)
plotm(dim, d, M1, M2, M3 = NULL, M4 = NULL, M5 = NULL, M6 = NULL, lim1, lim2, names1,
      names2, colores1, colores2, contf, contc, cotucker = FALSE)
tensorial(X, dimension, U)
desplegar(X, dimension)
results(X, title, names = NULL, axis = FALSE, first = FALSE)
every(p, q, r, T, iter, tol, mas = FALSE)
plotmt(dim1, dim2, dim3, sos, M1, M2, M3, lim1, lim2, lim3, names1, names2, names3,
       colores1, colores2, titles = FALSE)

Arguments

X,Y

the two arrays or lists with the numerical data, with or without labels. By default, if the labels are omitted, the names 1, 2, ... are used for the first dimension, V1, V2, ... for the second dimension, or R1, R2, ... for the third dimension. They are similarly defined for the rest of the analysis.

p,q,r

the number of components for each dimension to be retained. By default, if they are omitted, the analysis for all the combinations is computed.

P1,P2

the pair of components for the first dimension to be plotted with the Tucker3 analysis from the Co-Tucker3 for the two arrays separately. By default, if they are omitted, these plots are not obtained.

Q1,Q2

the pair of components for the second dimension to be plotted with the Tucker3 analysis from the Co-Tucker3 for the two arrays separately. By default, if they are omitted, these plots are not obtained.

R1,R2

the pair of components for the third dimension to be plotted with the Tucker3 analysis from the Co-Tucker3 for the two arrays separately. By default, if they are omitted, these plots are not obtained.

dimAX,dimAY

the axes for the first dimension to be plotted with the Co-Inertia analysis from the Co-Tucker3. By default, if they are omitted, these plots are not obtained.

dimBX,dimBY

the axes for the second dimension to be plotted with the Co-Inertia analysis from the Co-Tucker3. By default, if they are omitted, these plots are not obtained.

dimCX,dimCY

the axes for the third dimension to be plotted with the Co-Inertia analysis from the Co-Tucker3. By default, if they are omitted, these plots are not obtained.

coloresf

a vector with the labels of the colours for the first dimension. If it is omitted, black labels are used.

coloresc1,coloresc2

vectors with the labels of the colours for the second dimension of the two arrays. If they are omitted, black labels are used.

coloresc

vector with the labels of the colours for the second dimension of one array or list or one matrix for the rest of the analysis. If it is omitted, black labels are used.

maximo

the maximum number of components for each dimension to be retained. By default, if it is omitted, 5 is used.

iter

the maximum number of iterations computed for each combination of components. By default, if it is omitted, 100 is used.

tol

the minimum tolerance. By default, if it is omitted, 1e-08 is used.

norm

a logical value indicating whether the data should be normalized by lateral slices. By default, if it is omitted, it is FALSE.

contr

a logical value indicating whether the tables with the contributions for the first, second and third dimensions should be obtained. By default, if it is omitted, it is FALSE.

dimX,dimY,dimXx,dimYx,dimXy,dimYy

the axis to be plotted with the rest of the analysis. By default, if they are omitted, they are not obtained.

gruposf

a vector with the labels of the groups that the rows belong to. It has to have the same length as the number of rows.

cotucker

a logical value indicating whether the Co-Inertia Analysis to be performed comes from the Co-Tucker3 analysis for the first ot the third dimensions. By default, if it is omitted, it is FALSE.

tcotucker

a logical value indicating whether the Co-Inertia Analysis to be performed comes from the Co-Tucker3 analysis for the second dimension. By default, if it is omitted, it is FALSE.

filas, columnas, conf, columnas2

arguments for the auxiliary function colores.

cubo, capas

arguments for the auxiliary function preproc.

t

argument for the auxiliary function pesos.

M, names, title, first

arguments for the auxiliary functions contributions, contributions2, results.

dimension

argument for the auxiliary functions contributions2, tensorial, desplegar.

d

argument for the auxiliary functions screeplot, compr, plotm.

c, tucker

arguments for the auxiliary function compr.

dim, M1, M2, M3, M4, M5, M6, lim1, lim2, names1, names2, colores1, colores2, contf, contc

arguments for the auxiliary functions plotm, plotmt.

U

argument for the auxiliary function tensorial.

axis

argument for the auxiliary function results.

T, mas

arguments for the auxiliary function every.

dim1, dim2, dim3, sos, lim3, names3, titles

arguments for the auxiliary function plotmt.

Details

The number of elements of the first and third dimensions of both arrays must be the same.

The number of labels of the colours for the first and second dimensions of both arrays must be the same as the number of elements of the first and second dimensions of both arrays.

If there is any missing value in one row, this row is omitted.

maximo,iter must be integers greater than 1.

p,q,r must be integers greater than or equal to 1, and less than or equal to maximo and the number of elements of the corresponding dimension.

P1,P2 must be integers greater than or equal to 1, less than or equal to the number of elements of the first dimension, and it must be P1<P2 (exception: if only one component is retained). The same for Q1,Q2 and R1,R2.

dimAX,dimAY must be integers greater than or equal to 1, less than or equal to the number of elements of the first dimension, and it must be dimAX<dimAY. The same for dimBX,dimBY and dimCX,dimCY.

Value

If a combination of components has not been chosen, the result is a file with two tables: the one with all the combinations, and another with the combinations with a better fit. Moreover, a scree-plot, and a picture with the shape of the arrays are obtained.

If a combination of components has been chosen, the result is a file with three tables: the one with the percentages of fit for each component of each dimension, the core arrays, and the coordinates for each one of the dimensions. If contr is TRUE, the contributions of the three dimensions are obtained too.

If the axes (of the two individual Tucker3 analysis) have been chosen to be plotted, the graphics for the three dimensions of each array are obtained.

If the axes (of the two individual Tucker3 analysis) have not been chosen to be plotted, but the axes of the Co-Inertia Analysis have been chosen to be plotted, the three Co-Inertia Analysis are performed and the graphics with each one of the three dimensions according to both arrays are obtained.

Examples

1
2
3
4
5
6
7
8
# X<-array(sample(0:1000,size=1408,replace=TRUE)/100,dim=c(22,16,4))
# A<-X[,1:10,]
# B<-X[,11:16,]
# COTUCKER3(A,B)
# COTUCKER3(A,B)
# COTUCKER3(A,B,p=3,q=3,r=2)
# COTUCKER3(A,B,p=3,q=3,r=2,P1=1,P2=2,Q1=1,Q2=2,R1=1,R2=2)
# COTUCKER3(A,B,p=3,q=3,r=2,dimAX=1,dimAY=2)

Example output

Attaching package: 'KTensorGraphs'

The following object is masked from 'package:stats':

    screeplot

KTensorGraphs documentation built on Sept. 16, 2020, 5:07 p.m.