page_title: Gauss–Newton algorithm
section_title: Example
hierarchical_section_title: Gauss–Newton algorithm / Example
caption_attribution_description: Illustration of Gauss-Newton applied to a curve-fitting problem with noisy data. What is plotted is the best fit curve versus the data with the fitting parameters obtained via Gauss-Newton.
context_page_description: The Gauss–Newton algorithm is used to solve non-linear least squares problems. It is a modification of Newton's method for finding a minimum of a function. Unlike Newton's method, the Gauss–Newton algorithm can only be used to minimize a sum of squared function values, but it has the advantage that second derivatives, which can be challenging to compute, are not required.
  Non-linear least squares problems arise, for instance, in non-linear regression, where parameters in a model are sought such that the model is in good agreement with available observations.
  The method is named after the mathematicians Carl Friedrich Gauss and Isaac Newton, and first appeared in Gauss' 1809 work Theoria motus corporum coelestium in sectionibus conicis solem ambientum.
context_section_description: In this example, the Gauss–Newton algorithm will be used to fit a model to some data by minimizing the sum of squares of errors between the data and model's predictions.
  In a biology experiment studying the relation between substrate concentration [S] and reaction rate in an enzyme-mediated reaction, the data in the following table were obtained. 
  It is desired to find a curve (model function) of the form
  that fits best the data in the least-squares sense, with the parameters  and  to be determined.
  Denote by  and  the value of [S] and the rate from the table, . Let  and . We will find  and  such that the sum of squares of the residuals
  is minimized.
  The Jacobian  of the vector of residuals  with respect to the unknowns  is a  matrix with the -th row having the entries
  Starting with the initial estimates of  and , after five iterations of the Gauss–Newton algorithm the optimal values  and  are obtained. The sum of squares of residuals decreased from the initial value of 1.445 to 0.00784 after the fifth iteration. The plot in the figure on the right shows the curve determined by the model for the optimal parameters with the observed data.
caption: Calculated curve obtained with 
    
      
        
          
            
              
                
                  β
                  ^
                
              
            
            
              1
            
          
          =
          0.362
        
      
      {\displaystyle {\hat {\beta }}_{1}=0.362}
    
   and 
    
      
        
          
            
              
                
                  β
                  ^
                
              
            
            
              2
            
          
          =
          0.556
        
      
      {\displaystyle {\hat {\beta }}_{2}=0.556}
    
   (in blue) versus the observed data (in red).
exif: {}