Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Package | utility | |
Module | fitting | |
Tool | functionfitter |
fn | in | The function to fit | |
Allowed: | String expression or functional |
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.
- 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)