OptiMod sample report: Fetal ultrasound measurements and birth weight
Verification files
=====================================================================

What this is
------------
The sample Scientific Report presents an analysis that the OptiMod engine ran
automatically on a public dataset. With these files you can recompute the
reported numbers yourself, without OptiMod, from the public data and the
fitted model equation printed in the report.

Contents
--------
optimod-birth-weight-report.pdf   the sample Scientific Report (10 pages)
coefficients.csv                  the 13 coefficients of model LS1 (report, Section 08)
coefficient-covariance.csv        their covariance matrix (mgcv Bayesian covariance)
scaling.csv                       centres and standard deviations of the standardized predictors
reported-values.json              fit statistics and adjusted contrasts as reported
verify.py                         recomputes these values from the data

How to run
----------
1. Get the data. It is the dataset "ultra" of the R package gamlss.data and is
   not included here. In R:

       install.packages("gamlss.data")
       write.csv(gamlss.data::ultra, "ultra.csv", row.names = FALSE)

2. Run the script (Python 3.8 or later, no additional packages):

       python3 verify.py ultra.csv

The script prints every recomputed value next to the reported one and ends
with the number of values reproduced.

What is verified, and what is not
---------------------------------
Verified: the log-likelihood, AIC, R-squared and RMSE of the fitted model and
all adjusted contrasts of the report with their 95% confidence intervals
(delta method), 59 values in total.

Not covered: the automatic model search, the cross-validation and the holdout
audit. They are carried out by the OptiMod engine. The script is not part of
the engine; it only evaluates the published model equation.

Data source
-----------
gamlss.data: Data for Generalised Additive Models for Location Scale and Shape,
R package, version 6.0-7, dataset "ultra": second ultrasound scans and birth
weights of 1,038 births, Royal Hospital for Women, Sydney, 2008-2013.
Analysed in Stasinopoulos, Kneib, Klein, Mayr and Heller (2024), Generalized
Additive Models for Location, Scale and Shape, Chapter 8.
The package is distributed under GPL-2 | GPL-3. Please observe its terms when
you use the data.

Scope of the analysis
---------------------
Exploratory associations in observational data; not a clinical prediction
model. The limits are stated in Section 09 of the report.

OptiMod UG (haftungsbeschränkt) · https://optimod.ai
