6.3. Fitting Presets¶
The GUI provides three presets that map to NLSQ’s 3-workflow system.
6.3.1. The Three Presets¶
Preset |
Workflow |
Speed |
Best For |
|---|---|---|---|
Fast |
|
Fastest |
Quick fits, good initial guess |
Robust |
|
Moderate |
Unknown parameters, exploration |
Quality |
|
Slowest |
Publication-quality results |
6.3.2. Fast Preset¶
Settings:
Workflow:
autoTolerances:
1e-6Single local optimization
When to use:
You have a good initial guess
Data clearly follows the model
Quick exploratory fitting
Equivalent code:
popt, pcov = fit(
model, x, y, p0=[...], workflow="auto", ftol=1e-6, xtol=1e-6, gtol=1e-6
)
6.3.3. Robust Preset¶
Settings:
Workflow:
auto_globaln_starts: 10
Tolerances:
1e-8Requires bounds (prompted if not set)
When to use:
Initial guess is uncertain
Multiple local minima possible
First fit of new data
Equivalent code:
popt, pcov = fit(
model,
x,
y,
p0=[...],
workflow="auto_global",
bounds=bounds,
n_starts=10,
ftol=1e-8,
xtol=1e-8,
gtol=1e-8,
)
6.3.4. Quality Preset¶
Settings:
Workflow:
auto_globaln_starts: 20
Tolerances:
1e-10Thorough search
Requires bounds
When to use:
Publication-quality results needed
Final fit for reports
Maximum precision required
Equivalent code:
popt, pcov = fit(
model,
x,
y,
p0=[...],
workflow="auto_global",
bounds=bounds,
n_starts=20,
ftol=1e-10,
xtol=1e-10,
gtol=1e-10,
)
6.3.5. Choosing a Preset¶
Do you have good initial guess?
│
┌────┴────┐
│YES │NO
▼ ▼
┌──────┐ Need publication quality?
│ Fast │ │
└──────┘ ┌────┴────┐
│YES │NO
▼ ▼
┌─────────┐ ┌────────┐
│ Quality │ │ Robust │
└─────────┘ └────────┘
6.3.6. Typical Workflow¶
Start with Fast: Quick check if model fits
Use Robust if Fast fails: Better exploration
Finish with Quality: Final publication results
6.3.7. Setting Bounds for Global Presets¶
Robust and Quality presets require parameter bounds:
On Fitting Options page, click “Set Bounds”
For each parameter, enter lower and upper limits
Use physical constraints when known
Wider bounds = more exploration but slower
Tips for setting bounds:
Amplitude:
[0, max(y) * 2]Rates/decay:
[0, 10]or based on domain knowledgeCenters:
[min(x), max(x)]Widths:
[0.01, (max(x) - min(x))]
6.3.8. Comparing Results¶
After fitting with different presets, compare:
Parameter values: Should be similar
Uncertainties: Quality preset gives smaller errors
Chi-squared: Should be similar
Fit time: Fast << Robust < Quality
If results differ significantly between presets, the Robust/Quality result is likely more reliable.
6.3.9. Next Steps¶
The 3-Workflow System - Detailed workflow documentation
Common Issues - Troubleshooting