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


next up previous contents index
Next: functionfitter.setparameters - Function Up: functionfitter - Tool Previous: functionfitter.setdatafromtable - Function


functionfitter.setfunction - Function



Package utility
Module fitting
Tool functionfitter


Set the function you wish to fit


Synopsis
setfunction(fn)


Arguments

fn in The function to fit
    Allowed: String expression or functional


Returns
T or fail



Description

This function sets the function that you wish to fit to the data. You can set the function in one of two ways.

First, you can provide an expression string of an arbitrary function. See function compiled for details on the syntax for this string. Basically the parameters to be solved for are labelled p0, p1, p2... or alternatively p[1], p[2], p[3].... Similarly, you should use the labels x0, x1, x2... or alternatively x[1], x[2], x[3]... to refer to the abcissa (which must have the same dimensionality as the functional). For example, if your abcissa is 2-dimensional, you would use x0 (or x[1] or just x in this case) and x1 (or x[2).

Second, you can provide a pre-existing Functional tool. This might itself have been created from an expression string, or it may be a pre-defined functional (e.g. a Gaussian1D), or perhaps a compound functional. See the details on the Functionalserver tool.

Internally, a Functional tool is stored whether you provide it directly or indirectly.



Example
- include 'functionfitter.g'
- ff := functionfitter()
- ff.setfunction ('p0 + p1*x0 * p2*x0*x0')      # Second order polynomial
-
- include 'functionalserver.g'
- g := dfs.gaussian1d()                      # A 1-d Gaussian
- ff.setfunction(g)





next up previous contents index
Next: functionfitter.setparameters - Function Up: functionfitter - Tool Previous: functionfitter.setdatafromtable - 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