Compare models and accepted results

Check the residuals, compare the curves on the same observations and read the conditions attached to the statistical criteria.

GX-TXT DEV112 P011-bis

Keep two comparable candidates

  1. From Sources → Open built-in sample load circular_arc. Keep the same set of 41 points for both fits. Use Y = f(X), all and source domain.
  2. Choose linear, run Fit → Preview fit and then Accept. In Accept fitted curves write a unique name and press Accept named curves. Cancel returns to the project without storing that curve.
  3. Choose polynomial with Degree equal to 2, repeat Preview and Accept and use a different name. In Accepted fits select the candidates. Use Show / hide accepted fit to toggle the overlay. The numerical comparison works on the curves chosen in the dialog.
Synthetic arch with linear and square fit preserved in the same session.
Synthetic arc with linear and quadratic fits kept in the same session.

Use Compare accepted models

Open Results → Model comparison and diagnostics → Compare accepted models…. In the list select only fits with the same training observations, row identities, response and weighting conventions. Choose the Criterion and press Compare. The grid displays Fit, N, Free p, score, Status and Reason. Close returns to the fitter window.

rmse
Root-mean-square error in response units. On the sample the straight line has RMSE about 0.25486, the quadratic about 0.10934. The method is descriptive and does not penalize additional parameters.
aic
Akaike’s criterion, obtained from a comparable likelihood. It requires the declared Gaussian assumption, consistent weights and identified parameters. An estimated noise scale counts among the parameters.
aicc
AIC with a correction for finite sample size. Its availability depends on the number of observations and of estimated parameters. For nonlinear models it is a local approximation.
bic
Criterion with an N-dependent penalty. Compare it only between candidates with the same likelihood and response.

Lower values rank the selected candidates higher. The noise-free test gave an RMSE ranking, while for AIC, AICc and BIC the Reason field explicitly requires the Gaussian declaration. Apply Independent Gaussian — estimated variance before repeating Preview and Accept on the candidates. In the new comparison AICc is about 10.904 for the straight line and −56.030 for the quadratic, and AIC and BIC give the same ranking.

RMSE comparison table on the same 41 observations.
RMSE comparison table on the same 41 observations.
Unavailable state of AICc when the fits were accepted without declared Gaussian veracity.
Unavailable AICc state when the fits were accepted without a declared Gaussian likelihood.

Check significance and diagnostics

Nested F (first → second) compares the first, reduced model with the second, larger model. Order matters. You must be able to obtain the reduced model by constraining the larger one, using the same data and error structure. For example, a straight line is a quadratic whose second-degree coefficient is zero. If the dialog shows Invalid Interactive Document ID '' while the Workspace is still unnamed, save the Workspace first. With a saved Workspace and the Gaussian assumption specified, switching from a straight line to a quadratic returned F ≈ 168.48, with 1 additional coefficient and 38 residual degrees of freedom in the larger model. The reported p-value is about 1.53 × 10⁻¹⁵ and is valid under the assumptions of the nested-model comparison.

The Residuals vs source coordinate and Residuals vs predicted response controls change the diagnostic abscissa. Examine the structure of the residuals in both plots and check maps, curves and units. Reading residuals.

Result of the F test from the linear model to the square, with Workspace saved.
Result of the F test from the linear to the quadratic model, with the Workspace saved.

Components and families

Fit → Models and fitting → Model components… adds terms in the same response, such as the baseline and the two bands of the spectral exercise. Exercise with components.

Fit members separately

  1. Download famiglia_calibrazione.csv (unzip the archive first). Import it from Acquisition → Generic CSV as table.generic with s, V, 1 in column order. Open the Dataset in Curve Fitter and use the first two columns as X and Y.
  2. Open Fit → Models and fitting → Independent family sources…. Set Family / group Variable ID to v0003, the third column. Choose Choose members, select 1 and 2 and press Add independent sources . In the list Sources two new sources appear, with 8 rows each. Leave them selected for the batch fit. Close in the dialogs leaves the configuration.
  3. Choose the linear model and press Fit → Fit selected sources. The two Previews are computed separately with the same model settings. To store them, choose Fit → Accept selected previews, assign a name to each curve and press Accept named curves.
Choice of the two members to load as independent sources.
Choice of the two members to load as independent sources.

Fit and reopen a joint model

  1. Download famiglia_triodo_sintetica.csv (unzip the archive first). Import it in the same way with V, mA, V units. Add a curve with X_V as X and Y_mA as Y. The Vg_V column identifies four grid voltages, with 23 rows each.
  2. Open Fit → Models and fitting → Global family fit…. Set Physical family Variable to v0003 and Mathematical model to triode.koren_v1. Select Use the complete Dataset, including rows outside current filters and selections and press Review parameters. The calculation uses all the original rows in physical coordinates.
  3. For each parameter, shared estimates a single value for the whole family, local estimates one value per member and fixed keeps the initial value. In the Expanded initial values fields, Expanded lower bounds and Expanded upper bounds you can use the model defaults by leaving them empty. If you fill them in, separate the numbers with semicolons and enter the local values in increasing order of the family variable. Expanded fixed mask optionally accepts 0 or 1 per position, where 1 locks the value.
  4. To reproduce the test, leave all shared parameters and the Expanded fields empty. Set Solver to fminsearch, Maximum iterations to 1000 and Tolerance to 1e-10. Name the Job in Result Job name, then press Run global fit. Follow the execution in Session Jobs. The other solver, lsqnonlin, requires the Octave optim package. If the Job log reports that it is missing, open the dialog and select fminsearch.
  5. The verified joint report shows 92 observations and RMSE ≈ 0.000693 mA. mu, Kp, Kvb, Kg1 and Ex are about 8, 59.993, 300.012, 400 and 1.4 respectively. To reopen the report use Results → Results and publication → Global family results…, choose Joint result and press Open report . Open parameter table opens the coefficients and Open prediction table opens the predictions as a Session Dataset. If a new run has replaced one of the two Datasets, you can still reopen the report of the previous run.
Parameters of the global model and choice of the broom for each parameter.
Parameters of the global model and choice of the scope for each parameter.
Joint model report on four groups and 92 observations.
Joint model report on four groups and 92 observations.