Advanced Octave A70 — Estimation, comparison and uncertainty
Advanced GNU Octave with GX-TXT · Module 12
Now we draw the speeds of the two synthetic answers and compare the adaptation with a straight. The numerical uncertainty must always be accompanied by the assumptions that make it interpretable.
Objectives and prerequisites
Run A68 and A69’s controls. The test uses GX-TXT dev112-P011-bis and GNU Octave 9.4.0. Import stima_risposte.m, register it and run it in the Runner. The octave_project_fit_a and octave_project_fit_b forecast dataset are created-only: to repeat, use a new Session or change the IDs even in subsequent lessons.
Stimulate the two speeds
For each nonlinear_fit condition, it adapts the model to a 1-exp(-k*t) parameter to the published data, with an initial value of 0.6 s⁻¹. The programme compares the RMS of the residuals with that of a straight adapted to the same points and publishes separately the two non-linear forecasts. The callback is released at the end.
In the test A gives k ≈ 0.504253 s⁻¹ and B k ≈ 0.800799 s⁻¹. Nonlinear RMS are about 0.015110 and 0.021057; linear RMS about 0.094917 and 0.148208. They are errors on the same data used for the estimate: they do not constitute an independent verification of predictive ability.
Uncertainty and hypothesis
Assuming the standard deviation 0.02, independent errors and locally appropriate model, the script uses the SE(k) = sigma/sqrt(sum((t*exp(-k*t)).^2)) approximation. In the test we get about 0.010686 s⁻¹ for A and 0.020386 s⁻¹ for B. These are local standard errors, not 95% confidence intervals and not a measurement of model errors.
Here we know the generation form because the data is synthetic. A lesser RMS and convergence do not show that the same model is physically plausible in a real experiment: it requires knowledge of the system, residues, independent data and assessment of the hypotheses.
Exercise
- What condition does the higher estimated speed have?
- Is the comparison of RMS on independent data?
- What assumptions do they come into the calculation of the standard error?
Worked solution
- B, about 0.801 s⁻¹.
- No: Use the adaptation data.
- Independent noise with standard deviation known and adequacy of the local approximation of the model.
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