Skip to content

ref_joint

man/ref_joint.Rd

Also documents
  • predict.ref_joint

Usage

ref_joint(scores, covariance = c("shrinkage", "identity"), value = NULL)
predict.ref_joint(object, newdata, ...)

Fits a second-stage model on reference normal scores and scores new subjects against it:

Argument Description
scores A ref_scores or ref_transition table of reference
scores (out-of-fold for honest calibration), or the wide output of
augment() (its .z_<outcome> columns).
covariance "shrinkage" or "identity".
value Score column ("z" or "innovation_z").
object A ref_joint.
newdata A score table for new subjects (same outcomes).
... Unused.
  1. Take out-of-fold (or transition) normal scores of the reference.
  2. Estimate a Ledoit-Wolf / Schäfer-Strimmer shrinkage correlation matrix $R$.
  3. For a subject with observed outcomes $o$, compute $D^2 = z_o^\top R_{oo}^{-1} z_o$ on the observed submatrix.
  4. Base PIT $p = P(\chi^2_{|o|} \le D^2)$, which already accounts for how many outcomes were observed.
  5. Correct that PIT through its empirical distribution on the reference (leave-one-out ranks, $(\mathrm{rank}-0.5)/n$), so the joint centile is calibrated even when the copula is imperfect.

A ref_joint model. predict(joint, scores) returns one row per subject with d2, n_observed, joint_centile, and joint_z; joint$reference holds the reference rows scored leave-one-out.