Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Package | utility | |
Module | fitting | |
Tool | fitter |
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 |
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.
- 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