Darwin Help

Back to Index

LSBestSumDelete

Function LSBestSumDelete


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

AtA matrix(numeric) 
btA list(numeric) 
btb numeric 
Synopsis Least Squares approximation using the best sum of independent variables or best deleted variable. LSBestDelete finds the best pair of variables which can be replaced by their sum or the best variable that can be removed. This is best in the sense of increasing the norm of the residuals by the least amount. This function does the work of both LSBestSum and LSBestDelete in one pass. 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 or one value which is zero. 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. If i=0 then j is the variable to be removed. norm is the value of the resulting norm of the residuals, i.e. norm = ||Ax-b||^2 See Also: ?LSBestSum ?LSBestDelete