Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Package | utility | |
Module | mathematics | |
Tool | polyfitter |
coeff | The coefficients of the fit. The constant (0th-order) term is first, highest order term last. coeff[,1] are the coefficients for the first fit, coeff[,2] for the second, and so on. (Output) | ||
coefferrs | Estimated errors of the fit. coefferrs[,i] are the errors for the ith fit. (Output) | ||
chisq | for the fit. chisq[i] is the chi-square for the i'th fit. (Output) | ||
x | One dimensional array. (Input) | ||
y | Must be the same length as ``x'' in its first axis, the length of the second axis is the number of fits to do. (Input) | ||
sigma | Errors in the ``y'' values. If one dimensional, the sigmas are assumed to be the same for all fits. (Input) | ||
Default: | 1.0 | ||
order | Order of the highest term in the polynomial to fit. (Input) | ||
Allowed: | 0order10 | ||
Default: | 1 |
include "polyfitter.g" T x := 1:100 y := array(0, 100, 3) y[,1] := 5 # constant y[,2] := 2*x # linear y[,3] := 10*x*x # square fitter := polyfitter() fitter.multifit(coeff, coefferrs, chisq, x, y, order=2) 1 coeff[,1] # the first fit [5 -2.98023e-08 0] coeff[,2] # the second fit [0.00126371 2 3.93629e-08] coeff[,3] # the third fit [0.00238887 -0.000247818 10]