This function implements the two scatter matrices transformation to obtain an invariant coordinate sytem or independent
components, depending on the underlying assumptions.

Usage

1
2

Arguments

X

numeric data matrix or dataframe.

S1

name of the first scatter matrix function or a scatter matrix. Default is the regular covariance matrix.

S2

name of the second scatter matrix or a scatter matrix. Default is the covariance matrix based on forth order moments.
Note that the type of S2 must be the same as S1.

S1args

list with optional additional arguments for S1. Only considered if S1 is a function.

S2args

list with optional additional arguments for S2. Only considered if S2 is a function.

stdB

either "B" or "Z". Defines the way to standardize the matrix B. Default is "Z". Details are given below.

stdKurt

Logical, either "TRUE" or "FALSE". Specifies weather the product of the kurtosis values is 1 or not.

na.action

a function which indicates what should happen when the data
contain 'NA's. Default is to fail.

Details

Seeing this function as a tool for data transformation the result is an invariant coordinate selection which can be used for testing and estimation. And
if needed the results can be easily retransformed to the original scale. It is possible to use it also for dimension reduction, finding outliers or when
searching for clusters in the data.
The function can, however, also be used in a modelling framework. In this case it is assumed that the data were created by mixing independent components which
have different kurtosis values. If the two scatter matrices used have then the so-called independence property the function can recover the independent components
by estimating the unmixing matrix.

By default S1 is the regular covariance matrix cov and S2 the matrix of fourth moments cov4. However those can be replaced with any other
scatter matrix the user prefers. The package ICS offers for example also cov4.wt, covAxis, covOrigin or tM and in the ICSNP
are for example further scatters as duembgen.shape, tyler.shape, HR.Mest or HP1.shape.
But of course also scatters from any other package can be used.

Note that when function names are submitted, the function should return only a scatter matrix. If the function returns more, the scatter should be computed in advance or
a wrapper written that yields the required output. For example tM returns a list with four elements where the scatter estimate is called V. A simple wrapper would then be
my.tm <- function(x, ...) tM(x, ...)$V.

For a given choice of S1 and S2 the general idea of the ics function is to find the unmixing matrix B and the invariant coordinates (independent coordinates)
Z in such a way, that:

(i)

The elements of Z are standardized with respect to S1 (S1(Z)=I).

(ii)

The elements of Z are uncorrelated with respect to S2. (S2(Z)=D, where D is a diagonal matrix).

(iii)

The elements of Z are ordered according to their kurtosis.

Given those criteria, B is unique up to sign changes of its rows. The function provides two options to decide the exact form of B.

(i)

Method 'Z' standardizes B such, that all components are right skewed. The criterion used, is the sign of each componentwise difference of mean vector and
transformation retransformation median. This standardization is prefered in an invariant coordinate framework.

(ii)

Method 'B' standardizes B independent of Z such that the maximum element per row is positive and each row has norm 1. Usual way in an independent
component analysis framework.

In principal if S1 and S2 are true scatter matrices the order does not matter. It will just reverse and invert the kurtosis value vector.
This is however not true when not both of them are scatter matrices but one or both are shape matrices. In this case the order of the kurtosis values is also reversed,
the ratio however then is not 1 but only constant. This is due to the fact that when shape matrices are used, the kurtosis values are only relative ones.
Therefore by the default the kurtosis values are standardized such that their product is 1. If no standardization is wanted, the 'stdKurt' argument should be used.