"fitIWPCA"(X, constraint=c("diagonal", "baseline", "max"), baselineChannel=NULL, ..., aShift=rep(0, times = ncol(X)), Xmin=NULL)
matrix
where N is the number of observations and
K is the number of dimensions (channels).
character
string or a numeric
value.
If character
it specifies which additional contraint to be used
to specify the offset parameters along the fitted line; If "diagonal"
, the offset vector will be a point on the line
that is closest to the diagonal line (1,...,1).
With this constraint, all bias parameters are identifiable.
If "baseline"
(requires argument baselineChannel
), the
estimates are such that of the bias and scale parameters of the
baseline channel is 0 and 1, respectively.
With this constraint, all bias parameters are identifiable.
If "max"
, the offset vector will the point on the line that is
as "great" as possible, but still such that each of its components is
less than the corresponding minimal signal. This will guarantee that
no negative signals are created in the backward transformation.
If numeric
value, the offset vector will the point on the line
such that after applying the backward transformation there are
constraint*N
. Note that constraint==0
corresponds
approximately to constraint=="max"
.
With the latter two constraints, the bias parameters are only
identifiable modulo the fitted line.
constraint=="baseline"
.
This argument is optional if constraint=="diagonal"
and
then the scale factor of the baseline channel will be one. The
estimate of the bias parameters is not affected in this case.
Defaults to one, if missing.
list
that contains estimated parameters and algorithm
details;double
vector
$(a[1],...,a[K])$with offset
parameter estimates.
It is made identifiable according to argument constraint
.
double
vector
$(b[1],...,b[K])$with scale
parameter estimates. It is made identifiable by constraining
b[baselineChannel] == 1
.
These estimates are idependent of argument constraint
.
"diagonal"
,
a double
vector
$(adiag[1],...,adiag[K])$, where
$adiag[1] = adiag[2] = ... adiag[K]$, specifying the point
on the diagonal line that is closest to the fitted line,
otherwise the zero vector.
matrix
with columns of eigenvectors.
TRUE
if the algorithm converged, otherwise FALSE
.
NULL
.The algorithm is: For iteration i: 1) Fit a line $L$ through the data close using weighted PCA with weights $\{w_n\}$. Let $r_n = \{r_{n,1},...,r_{n,K}\}$ be the $K$ principal components. 2) Update the weights as $w_n <- 1 / \sum_{2}^{K} (r_{n,k} + \epsilon_r)$ where we have used the residuals of all but the first principal component. 3) Find the point a on $L$ that is closest to the line $D=(1,1,...,1)$. Similarily, denote the point on D that is closest to $L$ by $t=a*(1,1,...,1)$.
calibrateMultiscan
()
and normalizeAffine
() methods.
Internally the function iwpca
() is used to fit a line
through the data cloud and the function distanceBetweenLines
() to
find the closest point to the diagonal (1,1,...,1).