e02gaf

e02gaf © Numerical Algorithms Group, 2002.

Purpose

E02GAF L -approximation by general linear function 1

Synopsis

[b,x,resid,irank,iter,ifail] = e02gaf(a,b<,toler,ifail>)

Description

 
 Given a matrix A with m rows and n columns (m>=n) and a vector b 
 with m elements, the routine calculates an l  solution to the 
                                             1                
 over-determined system of equations
 
                               Ax=b.
 
 That is to say, it calculates a vector x, with n elements, which 
 minimizes the l -norm (the sum of the absolute values) of the 
                1                                             
 residuals
 
                                m     
                                --    
                          r(x)= >  |r |,
                                --   i
                                i=1   
 
 where the residuals r  are given by
                      i           
 
                         n       
                         --      
                  r =b - >  a  x ,   i=1,2,...,m.
                   i  i  --  ij j
                         j=1     
 
 Here a   is the element in row i and column j of A, b  is the ith
       ij                                             i         
 element of b and x  the jth element of x. The matrix A need not 
                   j                                            
 be of full rank.
 
 Typically in applications to data fitting, data consisting of m 
 points with co-ordinates (t ,y ) are to be approximated in the l 
                            i  i                                 1
 -norm by a linear combination of known functions (phi) (t),
                                                       j   
 
    (alpha) (phi) (t)+(alpha) (phi) (t)+...+(alpha) (phi) (t).
           1     1           2     2               n     n
 
 This is equivalent to fitting an l  solution to the over-
                                   1                
 determined system of equations
 
              n                       
              --                      
              >  (phi) (t )(alpha) =y ,   i=1,2,...,m.
              --      j  i        j  i
              j=1                     
 
 Thus if, for each value of i and j, the element a   of the matrix
                                                  ij        
 A in the previous paragraph is set equal to the value of 
 (phi) (t ) and b  is set equal to y , the solution vector x will 
      j  i       i                  i                            
 contain the required values of the (alpha) . Note that the 
                                           j               
 independent variable t above can, instead, be a vector of several
 independent variables (this includes the case where each (phi)  
                                                               i
 is a function of a different variable, or set of variables).
 

Parameters

e02gaf

Required Input Arguments:

a (:,:)                               real
b (:)                                 real

Optional Input Arguments:                       <Default>

toler                                 real     eps^(2/3)
ifail                                 integer  -1

Output Arguments:

b (:)                                 real
x (:)                                 real
resid                                 real
irank                                 integer
iter                                  integer
ifail                                 integer