Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: gauss1dfitter.eval - Function Up: gauss1dfitter - Tool Previous: gauss1dfit - Constructor


gauss1dfitter.fit - Function



Package utility
Module mathematics
Tool gauss1dfitter


Fit Gaussian(s) to y vector given x vector


Synopsis
fit(x, y)


Arguments

x   X coordinate at y values
    Allowed: vector double
y   Y values to fit. Must be the same length as x.
    Allowed: vector double


Returns
record


Description
Fit a sinusoid to y values given the x coordinate values. The state of the fit is indicated in the returned record.
state - Record The gauss1dfitter state record
state.converged has the fit converged?
  Allowed: boolean
  Default: F
state.curriter The number of iterations actually used in the most recent fit.
  Allowed: integer
  Default: 0
state.maxiter The maximum number of iterations tried by fit.
  Allowed: integer
  Default: 30
state.criteria The convergence criteria.
  Allowed: double
  Default: 0.001
state.chisq The $ \chi^{2}_{}$ for this fit.
  Allowed: double
state.height The heights of the Gaussians
  Allowed: vector double
state.center The centers of the Gaussians
  Allowed: vector double
state.width The widths of the Gaussians
  Allowed: vector double
state.heighterror The 1-sigma errors in the heights.
  Allowed: vector double
state.centererror The 1-sigma errors in the centers.
  Allowed: vector double
state.widtherror The 1-sigma errors in the widths.
  Allowed: vector double
The fit function first checks that x and y have the same length and that each of the parameter vectors have the same length. A fit is said to have converged when the fractional change in $ \chi^{2}_{}$ in two succeessive interations is less than the convergence criteria value. This value can be set in the setcriteria or setstate functions. If the fit has not converged after maxiter iterations, the fit function will stop and return the current state of the fit and the current $ \chi^{2}_{}$ value.





next up previous contents index
Next: gauss1dfitter.eval - Function Up: gauss1dfitter - Tool Previous: gauss1dfit - Constructor   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15