History of Least Script
Webb - all rights reserved - ©2004

modified by Russ Webb on  2004-04-22 21:03:33

Author - Hans Boggild
Email: boggild@nbivms.nbi.dk

Summary: least square fitting program 1,2,3 variables, with errors on points

Instructions: least makes a 1,2 or 3 parameter fit to a number of points : x, y, dy.

25/11 : program has been made a little smoother. New option is multiplication with sqrt of reduced Chi^2.

The fit function is :

1. a*f(x)  2. a*f(x)+b*g(x) or  3. a*f(x)+b*g(x)+c*h(x)
or the exponential of 1 2 or 3.
f,g,h can be chosen from the set  1, x, x^2 or ln(x). Some examples :
1 param, lin, f=1 : y=a : fit to constant
2 param, lin, f=1 g=x : standard linear y=a+bx
3 param, lin, f=1 g=x c=x*x : y=a+bx+cx^2
2 param, exp, f=1 g=lnx : y=exp(a+blnx)=Ax^b
3 param, exp, f=1 g=x h=lnx : y=x^c*exp(a+bx)
etc, etc

Instructions :

Start with CLR, clearing registers and define

1. lin or exp of function 2. define f,g,h (once
defined they remain defined until changed)

N times : x enter y enter dy  press [+]
last data point can be removed by [-]

After last data point press FIT and choose # of parameters

Then : a : a,da (in x,y regs..i.e. tos,nos)
       b : b,db (relevant if 2 or 3 param fit)
       c : c,dc (relevant if 3 param fit)
       X : chi^2, N, #param
       y(x) : extrapolated point, error of e.p.
       -D- : multiplies(error) with sqrt of reduced Chi^2

You can press FIT again to change # parameters, to
test relevance of these.

If you find anything wrong or want to ask/comment
please feel free to e-mail me.
Hans Boggild



[e]D'define f,g,h :|[f]|[g]|[h]|[done]|'c(CjXxCe:CjXyCe:CjXzCe:);