Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Package | utility | |
Module | fitting | |
Tool | functionfitter |
data | in | Plot the data and optional errors | |
Allowed: | T or F | ||
Default: | T | ||
model | in | Plot the model | |
Allowed: | T or F | ||
Default: | T | ||
fit | in | Plot the fit | |
Allowed: | T or F | ||
Default: | T | ||
resid | in | Plot the residual of the data and the fit | |
Allowed: | T or F | ||
Default: | F |
This function lets you plot the data and (optional) errors, model, fit and residuals of the data and fit.
Note that the model is evaluated from the internal functional and its parameters. If you have not explicitly set the parameters of the functional via the setparameters function, the model will evaluate to zero.
Note that at this point, the plotting interface has no impact on the x-space in which the fit is done. The fitting is always done in with the original x (abcissa) vector that you set.
- include 'functionfitter.g' - ff := functionfitter() - x := 1:10 - y := 3 + 2*x - yerr := 0.1*y; - ff.setdata (x,y,yerr) # Set data and y errors - ff.setfunction ('p0 + p1*x') - ff.setparameters ([2.8, 2.1]) # Set model (a bit wrong) - ff.fit(fixed=[T,F]) # Fit holding p0 fixed - ff.plot() # Plot data, model & fit