Skip to contents

kernel_scalar() is the dense-kernel analogue of scalar() / phylo_scalar(): one variance shared by every trait, coupled between grouping levels by the supplied dense matrix K (\(\boldsymbol\Sigma = \sigma^2\,\mathbf I_T\), \(\operatorname{Cov}(b_{gt}, b_{g't}) = \sigma^2 K_{gg'}\)). It uses the same phylo-equivalent diagonal engine path as kernel_indep(), with the per-trait variances tied to a single shared parameter, so extract_Sigma() exposes it under level = name.

Usage

kernel_scalar(unit, K, name = "kernel")

Arguments

unit

Unquoted grouping column whose levels align with rownames(K).

K

Numeric dense positive-semidefinite covariance or correlation matrix aligned to the grouping levels.

name

Character scalar used as the extractor level, e.g. extract_Sigma(fit, level = "cross").

Value

A formula marker; never evaluated as a regular R function.