>  Docs Center  >  Libraries  >  JHU/APL/S1R  >  LINE_FIT






      Fit a line to weighted x,y points.


Calling Sequence

      line_fit, x, y


      x, y = arrays of x, and y coordinates. in

Keyword Parameters


        WEIGHTS=wt Array of weights for points (def=1).
        XM=xm Returned weighted mean x.
        YM=ym Returned weighted mean y.
        SLOPE=b0 Returned slope of fitted line.
        XREG=b1 Regression coefficient of Y on X.
        YREG=b2 Regression coefficient of X on Y.
                    (use 1/b2 for slope to plot line)
        /PLOT Plot b0 line.
        /XPLOT Plot b1 line. Normal linear regression.
        /YPLOT Plot b2 line.
                    May give plot keywords (plot 1 line at a time).


Common Blocks


      Notes: By default line is fitted to minimize the sum of
      the mean square distances from the line using an
      algorithm by Robert Jensen. May also specify a regression
      of Y on X or X on Y. The fitted line passes through the
      mean point.

Modification History

      R. Sterner, 2001 Sep 10
      R. Sterner, 2007 Apr 24 --- Made sure b1 and b2 defined if used.
  Copyright (C) 2001, Johns Hopkins University/Applied Physics Laboratory
  This software may be used, copied, or redistributed as long as it is not
  sold and this copyright notice is reproduced on each copy made. This
  routine is provided as is without any express or implied warranties
  whatsoever. Other limitations apply as described in the file disclaimer.txt.

© 2020 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us