| Synopsis
|
SvdAnalysis does a least squares approximation and returns various measures
of quality of the fit.
Problem: Given a matrix of A (dim n x m) and a vector b (dim n),
we want to find a vector x (dim m) such that Ax ~ b.
This approximation is in the least squares sense,
i.e. ||Ax-b||^2 is minimum
The calling arguments are:
AtA is a matrix (dim m x m) which is the product A^t * A
btA is a vector (dim m) which is the product b^t * A
btb is the norm squared of b, i.e. ||b||^2 = b^t * b
NData is the number of data points (A is dim n x m)
names is a list (dim m) of the names associated with each
column of A, or with each value of x.
svmin is a positive numeric value. All singular values less than
svmin will not be used. Making svmin=0, all singular
values are used, and this is equivalent to pure least
squares. Alternatively, svmin can be the structure
First(k), where k is a positive integer not greater
than the dimension of AtA. In this case, the largest
k singular values will be used.
If the global variable ComputeSensitivity is set to false,
SvdAnalysis will not compute the sensitivity analysis and will
compute more quickly.
Output: The output is a darwin data structure
SvdResult( Norm2Err, SensitivityAnalysis, SingularValuesUsed,
SingularValuesDiscarded, Norm2Indep, MinNorm2Err,
SolutionVector, NData )
where:
Norm2Err is the norm squared of the resulting approximation, i.e.
||Ax-b||^2
SensitivityAnalysis is a list of 4-tuples with m entries, each one corresponding
for one variable. Each entry is [nnn,vvv,sss,ttt], where:
nnn is the name of the variable,
vvv is the result value (the x[i] value)
sss is an estimate of the standard deviation of vvv
ttt is the amount by which ||Ax-b||^2 will increase
if nnn would not be used. Two compute this
difference, all singular values are used.
The list is sorted by decreasing ttt
The list is only produced if the global variable
ComputeSensitivity is not set to false, otherwise it is
empty.
SingularValuesUsed is a list of the singular vales used ( > svmin )
SingularValuesDiscarded is a list of the singular values discarded ( <= svmin )
Norm2Indep is simply btb, the norm squared of the independent variables,
the maximum norm that could be reached
MinNorm2Err is the norm of ||Ax-b||^2 if all singular values were used,
i.e. is the minimum norm that could be achieved with
these m variables.
SolutionVector is the solution vector x
NData is the number of data points (A is of dimensions n x m)
A good summary explanation of the Svd analysis can be found in many
books, I like the one in Forsythe Malcolm and Moler, Computer Methods
for mathematical computations.
See Also: ?SvdBestBasis ?LSBestSum ?LSBestDelete ?LSBestSumDelete |