Skip to content

Usage

ref_dynamics(
reference,
data,
id,
time,
process = ref_process(),
crossfit = 5,
uncertainty = c("total", "conditional"),
n_draw = NULL
)

Attaches a Gaussian-copula process on marginal normal scores $Z=\Phi^{-1}(F(y\mid x))$. The default kernel is stable rank plus a Matern-3/2 process plus a measurement nugget, which is positive semidefinite for every irregular visit schedule.

Argument Description
reference A ref_fit.
data Longitudinal reference data.
id Subject identifier.
time Time variable (typically age).
process A kernel from ref_process().
crossfit Number of subject-level folds used to obtain
out-of-fold Z scores via ref_crossfit() (whole subjects stay in one
fold). 0 or NULL uses in-sample scores from reference.
uncertainty Marginal predictive estimand used to create every Z
score and every downstream transition or forecast. Defaults to
"total", matching predict.ref_fit().
n_draw Coefficient draws for total marginal uncertainty. The value
is stored and reused downstream.

Because the marginal scores have unit variance, the three variance components are estimated on the simplex $\tau_b^2 + \tau_g^2 + \sigma_e^2 = 1$ and the Matern length-scale is bounded by the observed lags. When all within-subject lags are (nearly) identical the length-scale is not identified and the model is automatically reduced to the stable-rank-plus-nugget kernel (process = "stable"), which has a single parameter: the correlation at the common lag. Optimisation is multi-start L-BFGS-B; when no start converges the process is reported as identified = FALSE and every history-conditioned quantity downstream is NA.

An object of class ref_dynamics with, per outcome, a fitted process ($processes), and a components table of normalised variance fractions with approximate standard errors.