Skip to contents

Canonical no-prefix name for the one-shared-variance trait covariance: a single variance \(\sigma^2\) shared by every trait with zero cross-trait covariance, giving \(\boldsymbol\Sigma_T = \sigma^2 \mathbf I_T\). It is the most parsimonious mode in the covariance grid.

Usage

scalar(formula)

Arguments

formula

0 + trait | g style formula (LHS is the trait factor, typically 0 + trait; RHS is the grouping factor).

Value

A formula marker; never evaluated.

Details

scalar() desugars byte-identically to indep(0 + trait | g, common = TRUE) – the two spellings fit the same model, tying all trait variances to one shared parameter. Use scalar() when you want to commit explicitly to one shared trait-scale variance; use indep() for a separate variance per trait, or dep() / latent() for cross-trait covariance.

The shared variance still couples grouping levels through the source (identity for the no-prefix row). The source-specific phylo_scalar(), animal_scalar(), and spatial_scalar() carry the same one-shared-variance meaning on their respective relationship operators.

Examples

if (FALSE) { # \dontrun{
# One shared trait variance across all traits (identity cross-trait):
fit <- gllvmTMB(value ~ 0 + trait + scalar(0 + trait | site),
                data = df, trait = "trait", unit = "site")

# Equivalent longhand:
fit <- gllvmTMB(value ~ 0 + trait + indep(0 + trait | site, common = TRUE),
                data = df, trait = "trait", unit = "site")
} # }