Darwin Help

Back to Index

LSBestSum

Function LSBestSum


Calling Sequence  LSBestSum(AtA,btA,btb)
Parameters
NameTypeDescription

AtA matrix(numeric) 
btA list(numeric) 
btb numeric 
Synopsis Least Squares approximation using the best sum of independent variables. LSBestSum finds the best pair of variables which can be replaced by their sum. This pair is best in the sense of increasing the norm of the residuals by the least amount. 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, where x has two values which are identical. 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^t * b Output: The output is a list with three values: [i,j,norm], where i and j are integers and are the indices of the variables which are replaced by their sum. norm is the value of the norm of the residuals with this sum, i.e. norm = ||Ax-b||^2 See Also: ?LSBestSumDelete ?LSBestDelete