Computes a cluster-robust covariance matrix with a Bell-McCaffrey style leverage adjustment (`CL2` in this package), clustering by curve.
gam_sandwich_cluster_cl2(
b,
cluster_id,
freq = FALSE,
tol = 1e-08,
leverage_cap = 0.999
)A p x p covariance matrix.
Fitted GAM object (must not have class `"pffr"`).
Integer vector mapping each vectorized observation to a curve.
If `TRUE`, use frequentist sandwich (`B2 = 0`). If `FALSE` (default), use Bayesian sandwich (`B2 = Vp - Ve`).
Eigenvalue floor for numerical stability.
Cap for cluster leverage eigenvalues (< 1).