tca: Taxicab Correspondance analysis

Description Usage Arguments Details Value Examples

View source: R/tca.R

Description

Computes the Taxicab correspondance analysis of a matrix of non-negative numbers

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
tca(
  Y,
  nAxes = 2,
  dataName = NULL,
  combineCollinearRows = c(F, T),
  combineCollinearCols = c(F, T),
  algorithm = c("exhaustive", "criss-cross", "genetic"),
  returnInputMatrix = c(T, F),
  verbose = (nAxes > 2),
  exhaustiveAlgorithmMaxnCol = 20,
  L1MaxDeltaMax = 10^-10
)

Arguments

Y

A m x n matrix of non-negative numbers. If Y is not a matrix, the 'as.matrix' transformation will be attempted. Missing values are not allowed.

nAxes

Number of axes to compute

dataName

A name to be used to identify the outputs in 'plot' and 'saveTCA' ()

combineCollinearRows

Should collinear rows be combined?

combineCollinearCols

Should collinear columns be combined?

algorithm

Algorthim requested - may be abreviated to first two letters

returnInputMatrix

Will the input matrix be returned

verbose

Report progress (default) or not

exhaustiveAlgorithmMaxnCol

Maximum size for exhaustive search

L1MaxDeltaMax

Change of L1 norm acceptable for convergence in iterative searches

Details

Computations are carried out on the transposed matrix if nrow(Y) < ncol(Y). In the following, we assume that nrow(Y) >= ncol(Y)

Row and column names will be created if necessary.

Zeros rows and columns are removed.

If ncol(Y) <= exhaustiveAlgorithmMaxnCol the exhaustive algorithm used unless otherwise specified.

If ncol(Y) > exhaustiveAlgorithmMaxnCol the genetic algorithm used unless otherwise specified.

Algorithm = exhaustive is overridden if ncol(Y) > exhaustiveAlgorithmMaxnCol.

For ncol(Y) <= exhaustiveAlgorithmMaxnCol, the user may want to specify algorithm = genetic is nrow(Y) is very large, since exhaustive computation may be slow.

If ncol(Y) <= exhaustiveAlgorithmMaxnCol the genetic algorithm is used unless otherwise specified.

(ncol(Y) = 20 appears to be the maximum practical on 2017 vintage Intel-based desktops).

Value

A list with class 'tca' containing the following components:

dispersion

A nAxes-length vector of matrix of column contributions

rowScores

A m x nAxes matrix of column contributions

colScores

A nAxes x n matrix of row contributions

rowMass

Row weights: apply(Y,1,sum)/sum(Y)

colMass

Column weights: apply(Y,2,sum)/sum(Y)

dataName

A name to be used to identify the output in 'plot' and 'save'

algorithm

Algorithm used (may be different from the algorythm requested)

dataMatrixTotal

Sum of the input matrix entries

dataMatrix

The matrix used in the computation

rowColCombined

A list describing removed or combined rows and columns, if any

Examples

1
2
tca(rodent,nAxes=4)
tca(rodent,nAxes=4,combineCollinearRows=c(TRUE,FALSE))

TaxicabCA documentation built on Dec. 11, 2019, 5:07 p.m.

Related to tca in TaxicabCA...