%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%.COPYRIGHT  (c)  1990 European Southern Observatory
%.IDENT      regrespoly.hlq
%.AUTHOR     JDP, IPG/ESO
%.KEYWORDS   MIDAS, help files, REGRESSION/POLYNOMIAL
%.PURPOSE    On-line help file for the command: REGRESSION/POLYNOMIAL
%.VERSION    1.0  28-FEB-1984 : Creation, JDP
%----------------------------------------------------------------
\se
SECTION./POLY
\es\co
REGRESSION/POLYNOMIAL					28-FEB-1984  JDP
\oc\su
REGRESSION/POLY table y x1[,x2] d1[,d2]
	polynomial fit on table columns
\us\pu
Purpose:    
            Polynomial fit of one or two variables  between  table columns.
\up\sy
Syntax:     
            REGRESSION/POLYNOMIAL table y x1[,x2] degree1[,degree2]
\ys\pa
            table = the table name
\ap\pa
            y = column acting as dependent variable
\ap\pa
            x1,x2  = column(s) acting as independent variable(s)
\ap\out
Output:
            Output from the fit is displayed on the terminal and stored in 
            the following keywords:
            OUTPUTC   - character information\\
            OUTPUTR(1)- minimum value of x\\
                   (2)- maximum value of x\\
                   (3)- minimum value of y (optional)\\
                   (4)- maximum value of y (optional)\\
                   (5)- Standard error of the estimate\\
            OUTPUTI(1)- N,no.of data,\\
                   (2)- M,no.of ind.var.\\
                   (3)- col.no. of dep.var.
                   (4)- col.no. of indep.var.\\
                   (5)- \\
                   (6)- degree (ND)\\
            OUTPUTD(i)- Coefficients\\
                        i=1,...,ND+1
\tuo\no
Note:
            Standard error of the estimate is calculated with factor "1/(N-1)"!
\on\sa
See also:
            SAVE/REGRESSION, COMPUTE/REGRESSION
\as\exs
Examples:
\ex
            REGRESSION/POLYNOMIAL data :Z :X 2
\xe\ex
            SAVE/REGR   data COEF
\xe\ex
            COMPUTE/REGR data :FIT = COEF
              Will fit the function :Z = a0 + a1*:X + a2*:X**2,
              save the coefficients in the table `data.tbl' with the name COEF
              and compute the result of the linear fit in column :FIT.
\xe\ex
            REGRESSION/POLYNOMAIL data :Z :X,:Y 2,2
\xe\ex
            SAVE/REGR   data COEF
\xe\ex
            COMPUTE/REGR data :FIT = COEF
              Will fit the function :Z = a0 + a1*:X + a2*:X**2 +  
                                         a3*:Y+ a4*:X*:Y + a5*:X**2:Y +
                                         a6*:Y**2 + a7*:X*Y**2 + a8*:X**2*:Y**2
              and save the coefficients in the table `data.tbl' with the 
              name COEF.
\xe\ex
	A more elaborate example shows how to use the command with different
	tables (i.e. use the result of the regression in another table):

	  REGRE/POLYN sofi_red_lo_res1 :lambda :d{isbin} 3
	  SAVE/REGRE sofi_red_lo_res1 lambdacal
	  COMP/REGR sofi_red_lo_res1 :lambda_regr = lambdacal(:d{isbin})

	  COPY/DD sofi_red_lo_res1.tbl LAMBDACALC  rebin_buf.tbl LAMBDACALC
	  COPY/DD sofi_red_lo_res1.tbl LAMBDACALI  rebin_buf.tbl LAMBDACALI
	  COPY/DD sofi_red_lo_res1.tbl LAMBDACALD  rebin_buf.tbl LAMBDACALD
	  COPY/DD sofi_red_lo_res1.tbl LAMBDACALR  rebin_buf.tbl LAMBDACALR
	  COPY/DD sofi_red_lo_res1.tbl TLABL034    rebin_buf.tbl TLABL034

	  COMP/REGR  rebin_buf :lambda_regr = lambdacal(:lambda)
\xe\sxe

