- description: sddsmpfit does ordinary and Chebyshev polynomial fits to column data, including error analysis. It will do fits to with specified number of terms, with specific terms only, and with specific symmetry only. It will also eliminate spurious terms. The options for sddsmpfit are very similar to those for sddspfit.
- synopsis:
sddsmpfit [-pipe=[input][,output]] [inputFile] [outputFile] -independent=xName [-sigmaIndependent=xSigmaName] -dependent=yName[,yName...] [-sigmaDependent=templateString] -terms=number [-symmetry={none | odd | even}] | -orders=number[,number...] [-reviseOrders[=threshold=chiValue][,verbose]] [-chebyshev[=convert]] [-xOffset=value] [-xFactor=value] [-sigmas=value,{absolute | fractional}] [-modifySigmas] [-generateSigmas[=keepLargest | keepSmallest]] [-sparse=interval] [-range=lower,upper] [-normalize[=termNumber]] [-verbose] [-evaluate=filename[,begin=value][,end=value][,number=integer]] [-fitLabelFormat=sprintfString] [-infoFile=filename]

- files: inputFile is an SDDS file containing columns of data to be fit. If it contains multiple pages, they are processed separately. outputFile is an SDDS file containing one page for each page of inputFile. It contains columns of the independent and dependent variable data, plus columns for error bars (“sigmas”) as appropriate. The values of the fit and of the residuals are in a columns named yNameFit and yNameResidual. In addition, various parameters having names beginning with yName are created that give reduced chi-squared, slope, intercept, and so on.
- switches:
- -pipe[=input][,output] — The standard SDDS Toolkit pipe option.
- -evaluate=filename[,begin=value][,end=value][,number=integer] — Specifies creation of an SDDS file called filename containing points from evaluation of the fit. The fit is normally evaluated over the range of the input data; this may be changed using the begin and end qualifiers. Normally, the number of points at which the fit is evaluated is the number of points in the input data; this may be changed using the number qualifier.
- infoFile=filename — Specifies creation of an SDDS file containing results of the fits in columns. A column called yNameCoefficient is created for each column that is fitted.
- By default, an ordinary polynomial fit is done using a constant and linear term. Control of
what fit terms are used is provided by the following switches:
- -terms=number — Specifies the number of terms to be used in fitting. 2 terms is linear fit, 3 is quadratic, etc.
- -symmetry={none | odd | even} — When used with -terms, allows specifying the symmetry of the N terms used. none is the default. odd implies using linear, cubic, etc., while even implies using constant, quadratic, etc.
- -orders=number[,number...] — Specifies the polynomial orders to be used in fitting. The default is equivalent to -orders=0,1.
- -reviseOrders[=threshold=value][,verbose] — Asks for adaptive fitting to be performed on the first data page to determine what orders to use. Any term that does not improve the reduced chi-squared by value is discarded. Similar to but much less capable than the adaptive fitting feature of sddspfit.
- [-chebyshev[=convert]] — Asks that Chebyshev T polynomials be used in fitting. If convert is given, the output contains the coeffients for the equivalent ordinary polynomials.

- -xOffset=value, -xFactor=value — Specify offseting and scaling of the independent data prior to fitting. The transformation is x → (x - Offset)∕Factor. This feature can be used to make a fit about a point other than x=0, or to scale the data to make high-order fits more accurate.
- sddsmpfit will compute error bars (“sigmas”) for fit coefficients if it has knowledge of the
sigmas for the data points. These can be supplied using the -columns switch, or generated
internally in several ways:
- -sigmas=value{absolute | fractional} — Specifies that independent-variable errors be generated using a specified value for all points, or a specified fraction for all points.
- -modifySigmas — Specifies that independent-variable sigmas be modified to include the effect of uncertainty in the dependent variable values. If this option is not given, any x sigmas specified are ignored.
- -generateSigmas[={keepLargest | keepSmallest}] — Specifies that independent-variable errors be generated from the variance of an initial equal-weights fit. If errors are already given (via -column), one may request that for every point sddsmpfit retain the larger or smaller of the sigma in the data and the one given by the variance.

- -sparse=interval — Specifies sparsing of the input data prior to fitting. This can greatly speed computations when the number of data points is large.
- -range=lower,upper — Specifies the range of independent variable over which to do fitting.
- -normalize[=termNumber] — Specifies that coefficients be normalized so that the coefficient for the indicated order is unity. By default, the 0-order term (i.e., the constant term) is normalized to unity.
- -verbose — Specifies that the results of the fit be printed to the standard error output.
- -fitLabelFormat=sprintfString — Specifies the format to use for printing numbers in the fit label. The default is “%g”.

- see also:
- author: M. Borland, ANL/APS.