[UP]


Manual Reference Pages  - julfit (3)

NAME

julfit(3f) - [M_math:fit] linear least squares curve fits, destroys input arrays

CONTENTS

Synopsis
Description
Options
Returns

SYNOPSIS

subroutine julfit(x,y,ixn,itype,a,b,r2)

   integer,intent(in) :: ixn
   real               :: x(ixn),y(ixn)
   integer,intent(in) :: itype
   real,intent(out)   :: a,b,r2

DESCRIPTION

use method of least squares to find a fit to the data. the expression being fitted is of one of several forms that have in common the fact that the expression will plot as a straight line if the proper axis type is selected.

     type  x-axis y-axis   significance of a and b

1 linear linear y=a*x+b # linear function 2 linear log y=a*b**x # exponential function 3 log linear y=a*log10(x)+b # logarithmic function 4 log log y=a*x**b # power functions: hyperbolic if b <0; parabolic if b > 0. 5 linear log y=a*e**(-b*x) # a common variant of the exponential form.

OPTIONS

x array of x values, input
y array of y values, input that are changed to hold the output
ixn number of points in arrays x and y to use
itype expression being solved
1. Y=a*X+b
2. Y=a*b**X
3. Y=a*log10(X)+b
4. Y=a*X**b
5. Y=a*e*(-b**X)

NOTE: odd use of arrays specifically optimized for calling from USH

RETURNS

a slope of linearized line
b y intercept of linearized line
r2 correlation coefficient (1=perfect)

         In general, if the correlation coefficient is <0.5 the correlation
         is regarded as insignificant. If it is >0.8 the derived linear fit
         is considered highly significant.


julfit (3) March 11, 2021
Generated by manServer 1.08 from 3fc840e8-1b7e-4ecb-92c3-e5b5a35c9d74 using man macros.