Advanced Octave A31 — Model catalog and parameters
Advanced GNU Octave with GX-TXT · Module 06
Before adapting a model to data it is necessary to know what it represents, what parameters it requires and what hypotheses it uses. Curve Fitter’s public cards help you explore this information directly from an Octave script.
Objectives and prerequisites
The introductory course introduced regression and fitting. We now begin an advanced path by questioning the DATASET_CURVE_FIT_API_v1/model_cards catalog via the Bridge. The test uses GX-TXT dev112-P011-bis and GNU Octave 9.4.0.
Read a tab
Import catalogo_modelli.m, register it and run it in the Runner.
% Advanced Octave course A31: inspect public Curve Fitter model cards.
% SPDX-License-Identifier: GPL-3.0-or-later
gxtxt_api_require({'DATASET_CURVE_FIT_API_v1@1'});
cards = gxtxt_api_call('DATASET_CURVE_FIT_API_v1','model_cards',{});
fprintf('Model cards available: %d\n',numel(cards));
if !isempty(cards)
fprintf('First available model card:\n');
if iscell(cards), disp(cards{1}); else, disp(cards(1)); endif
endif
Control on the empty set avoids requiring the first tab when the catalog does not contain it. The iscell branch allows you to read the first item in the form of container actually received; it does not assume that the order of the catalog is stable between versions.
In the test the catalog contains 22 tabs and the first describes the linear regression. Identifying, equation, parameters, domain, method and indications on uncertainty and extrapolation are visible. The number of cards and the first item can change with installed releases and modules.
Read the card critically
For a straight, intercept and slope have different units: if the output is in volts and the entrance in seconds, the intercept is in volts and the slope in volts per second. The board helps to identify parameters and hypotheses, but does not show that the model is suitable for the data of a particular experiment.
Before the fit, consider domain, units, initial conditions when required, weights and parameters limits. After the fit test diagnostics and residues. A catalog description is model documentation; it is not an adapted result or a physical proof of validity.
Exercise
- Will the first tab of your catalogue always be the linear one?
- What units do you have the slope if the output is in volt and the time in seconds?
- Does the presence of a model in the catalog guarantee that it describes your experiment?
Worked solution
- No. Order and availability can change; identify the model from its ID and verify the version.
- Volt per second.
- No. It is necessary to evaluate hypotheses, data, fit and scientific interpretation.
Other steps of this project
- Advanced Octave A75 — Dynamical systems in phase space
- Advanced Octave A81 — Geography of the waves and a 3D surface
- Advanced Octave A82 — Age, sex and demographic inequalities
- Advanced Octave A83 — All-cause mortality, certified COVID deaths and surveillance
- Advanced Octave A84 — A reproducible public account
- Advanced Octave A73 — Optimization landscapes and 3D trajectories