Fit DKGE from precomputed subject effect kernels
Source:R/dkge-fit-from-kernels.R
dkge_fit_from_kernels.RdConverts a list of subject-level effect kernels \(K_s \in \mathbb{R}^{q \times q}\) into synthetic GLM inputs that reuse [dkge_fit()] without modifying the core implementation. Each kernel is factorised into a symmetric square root, scaled to keep the pooled design metric unchanged, and paired with an identity design matrix so the resulting DKGE fit matches the supplied kernels.
Usage
dkge_fit_from_kernels(
K_list,
effect_ids,
subject_ids = NULL,
design_kernel = NULL,
sqrt_tol = 1e-10,
...
)Arguments
- K_list
List of symmetric positive semi-definite matrices sharing the same effect ordering.
- effect_ids
Character vector of length \(q\) naming the shared effect (anchor) indices.
- subject_ids
Optional character vector naming subjects. Defaults to the names of `K_list` or sequential identifiers.
- design_kernel
Optional design kernel passed to [dkge_fit()]. Defaults to the \(q \times q\) identity matrix, which matches the whitened anchor setup.
- sqrt_tol
Eigenvalue tolerance used when extracting square roots.
- ...
Additional arguments forwarded to [dkge_fit()].