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


next up previous contents index
Next: fitter.fitpoly - Function Up: fitter - Tool Previous: fitter.functional - Function


fitter.fitavg - Function



Package utility
Module fitting
Tool fitter


Get an average


Synopsis
fitavg(y, sd, wt, id)


Arguments

y in observed values of the condition equations
    Allowed: N x m values
sd in standard deviation of equations
    Allowed: one or more values used cyclically
    Default: unset
wt in an optional alternate for sd
    Allowed: one or more values used cyclically
    Default: 1
id in the id of a sub-tool
    Allowed: fitter id
    Default: 0


Returns
bool


Description
fitavg will calculate the average of a set of values.

The method expects that the properties of the fitter to be used have been initialized or set (like the number of simultaneous solutions m; the type; factors). The main reason is to limit the number of parameters on the one hand, and on the other hand not to depend on the actual array structure in Glish to get the variables and type. The number of unknowns is by definition 1.



Example
- include 'fitting.g'
- fit := fitter();		# a fitter for complex
- fit.set(type='com')
- fit.getstate()		# what is it like
[n=0, typ=1, colfac=1e-08, lmfac=0.001, type=complex] 
- fit.fitavg(1:6 + (2:7)*1i)	# equations are x=1+2i; x=2+3i; ... x=6+7i
T
- fit.getstate()		# what is it like now: note n=1
[n=1, typ=1, colfac=1e-08, lmfac=0.001, type=complex] 
- print fit.solution(), fit.error() #  show solution
3.5+4.5i 0.763763+0.763763i





next up previous contents index
Next: fitter.fitpoly - Function Up: fitter - Tool Previous: fitter.functional - Function   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