Produced by IDL 7.1.1
User Documentation

./toolbox
ortho_fit.pro

Last modification date:
Wed Sep 28 13:27:11 2016

ortho_fit

function ortho_fit(xx, yy, nfit, cfit, rms)

Function uses general orthogonal polynomial to do least squares fitting.

This code came from Tom Bania's GBT_IDL work. Local modifications include:

Returns
polyfit array: contains information for fitting to arbitrary points using the recursion relations
Examples
fit a 3rd order polynomial to the data in !g.s[0]
    yy = *(!g.s[0].data_ptr)
    xx = dindgen(n_elements(yy))
    f = ortho_fit(xx, yy, 3, cfit, rms)
 
Version
$Id$

Parameters
xx
in, required
The x-values to use in the fit.
yy
in, required
The data to be fit at xx.
nfit
in, required
integer
The order of the polynomial to fit.
cfit
out, required
variable
On return, cfit has coefficients of the polynomial
 fit = sum(m) a_m x^m 
 
because of round-off using this form gives unreliable results above about order 15 even for double precision. See ortho_poly for a better discussion on the contents of cfit.
rms
out, required
variable
The rms error for each polynomial up to order nfit.


Produced by IDLdoc 1.6 on Wed Sep 28 13:27:39 2016