Skip to content

c — Fitting

Commands for creating, configuring, and running curve fits. See Curves & Fitting for a conceptual guide with worked examples, convolution, and parameter strategies.

Core commands

Command Action
cc <expr> Create curve attached to the current data file
cca <expr> Create artificial curve (no data reference)
cm Modify the curve expression interactively
cd <k> Set the data file to fit (expression for k allowed)
cv <k> Set convolution file; cv- disables convolution
cr Set fit range restriction (expression selecting points)
cf Run fit
cfs Run fit, allow slow O(N²) convolution
cp Print parameters
ci <n> Extract parameter n into a new workspace; ci * for all
cx <n> Fix parameter n (exclude from fit)
cu <n> Unfix (release) parameter n
cg <n> Make parameter n global

cg — global parameters

By default each spectrum in a curve file has its own independent copy of each parameter. Making a parameter global forces all spectra to share one common value for that parameter, which is then optimised jointly across all spectra during cf. Useful for a background or resolution shift that is known to be the same for every spectrum.

Weighting

The weighting scheme determines how residuals are weighted in the least-squares sum. The default cwv is appropriate when y values have associated error bars dy.

Command Weighting scheme
cwc Constant (all points equal weight)
cwl Logarithmic
cwv Reciprocal variance 1/dy² (default)
cwvd Reciprocal variance, using data dy only
cwvc Reciprocal variance, using curve dy only

Curve plotting options

Command Action
cgd+ Evaluate curve at the x points of the data file
cgd- Evaluate curve on an equidistant grid (default)

Fit solver settings

These settings rarely need changing. The defaults work for most fits.

Command Action
csf Gradient step factor
cse Step size for numerical differentiation (√ε)
csc Maximum number of solver calls
csv Solver verbosity (0 = silent, higher = more output)
csm Fit metric (least squares, etc.)
cst Maximum fit duration (seconds)

Numerical integration settings

Used only when the curve expression contains an integral (e.g. a distribution model). Leave at defaults unless the solver reports integration errors.

Command Action
cn? Show current integration parameters
cnm Integration mode
cna Absolute error tolerance (eps_abs)
cnr Relative error tolerance (eps_rel)