next up previous contents index
Next: 3.5 Mathematical Syntax and Operations Up: 3 Structure and Syntax of Previous: 3.3 Dynamic Variables: set(), def(),


3.4 Fitting Variables: guess()

In the previous section, we discussed two varieties of scalars: those that are def()ined as expressions of other scalars and arrays, and those that are set() to a static value. There is actually a third category: fitting variables. These are a lot like static (set()) scalars except that their values will be changed by the fitting commands minimize() and feffit(). Fitting variables are a little special in that they keep track of their uncertainties and correlations with other variables as well as their value. To define a fitting variable, and to give the initial value for it, you use the guess() command, which has a syntax like this:

 Ifeffit> guess my_age = 19
There are no fitting arrays or fitting strings.

It should be clear that many commands alter the values of scalars. For example, pre_edge() can alter the value of e0. But in this case e0 is not considered a fitting variable in pre_edge(), because it is not defined as a guess()ed scalar. You may, however, define a fitting variable e0 when doing fitting of the XAFS with the feffit() command. That is, a scalar is a fitting variable if it was defined with guess(), not just if its value changes.

After a fit is executed (either with the feffit() or minimize() command), an estimate of the uncertainties in the fitted variables will be determined and stored in scalar variable. The variable will be named with a delta_ pre-pended to each variable name: delta_air_lines will contain the uncertainty in air_lines, and so on.

Finally, there is an unguess() command that will turn all fitting variables into regular scalars, with their current value. This effectively does a set() on all variables, and can be very convenient when changing fitting models, as unused variables can make it impossible to determine error bars. For complicated macros, scripts, or programs, it is usually a good idea to execute an unguess() before executing your guess() commands to clear any unwanted variables.


next up previous contents index
Next: 3.5 Mathematical Syntax and Operations Up: 3 Structure and Syntax of Previous: 3.3 Dynamic Variables: set(), def(),
Matt Newville
2004-02-09