sddsmpfit

**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*yName*`Fit`and*yName*`Residual`. 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=`-- Specifies creation of an SDDS file called*filename*[,begin=*value*][,end=*value*][,number=*integer*]*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=`-- Specifies creation of an SDDS file containing results of the fits in columns. A column called*filename**yName*Coefficient 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=`-- Specifies the number of terms to be used in fitting. 2 terms is linear fit, 3 is quadratic, etc.*number*`-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=`-- Specifies the polynomial orders to be used in fitting. The default is equivalent to*number*[,*number*...]*-orders=0,1*.`-reviseOrders[=threshold=`-- 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*][,verbose]*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=`-- Specify offseting and scaling of the independent data prior to fitting. The transformation is . 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.*value*`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=`-- Specifies that independent-variable errors be generated using a specified value for all points, or a specified fraction for all points.*value*{absolute | fractional}`-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=`-- Specifies sparsing of the input data prior to fitting. This can greatly speed computations when the number of data points is large.*interval*`-range=`-- Specifies the range of independent variable over which to do fitting.*lower*,*upper*`-normalize[=`-- 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.*termNumber*]`-verbose`-- Specifies that the results of the fit be printed to the standard error output.`-fitLabelFormat=`-- Specifies the format to use for printing numbers in the fit label. The default is ``%g''.*sprintfString*

**see also:**- Data for ExamplesData for Examples (see )exampleData
- sddspfit
`sddspfit`()sddspfit - sddsoutlier
`sddsoutlier`()sddsoutlier

**author:**M. Borland, ANL/APS.