Skip to contents

Canonical name for the always-alone marginal-only per-trait diagonal variance term. Mathematically identical to unique(0 + trait | g) standalone (both produce \(\boldsymbol\Sigma = \mathrm{diag}(\sigma^2_t)\) with identity off-diagonals); the keyword choice is documentary, not operational.

Usage

indep(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

The package's covstruct API organises around two mutually exclusive modes, distinguished by convention:

Decomposition (latent + unique)

Shared cross-trait covariance plus trait-specific residual: \(\boldsymbol\Sigma = \boldsymbol\Lambda \boldsymbol\Lambda^\top + \mathbf S\).

Marginal (indep standalone)

Per-trait total variance with no cross-trait decomposition: \(\boldsymbol\Sigma = \mathrm{diag}(\sigma^2_t)\).

Use indep() when you want to commit to the marginal-only interpretation explicitly. Use unique() paired with latent() when you want the cross-trait decomposition; unique() standalone (e.g. for observation-level random effects in mixed-response fits) also remains legitimate.

Mutual exclusion with latent()

Combining indep(0 + trait | g) with latent(0 + trait | g, d = K) on the same grouping is over-parameterised (the model cannot decide whether trait variance lives in the shared component or the marginal component). The parser raises a cli::cli_abort() in this case. Combining indep with unique on the same grouping is similarly redundant and also errors.

Examples

if (FALSE) { # \dontrun{
# Marginal-only fit (per-trait variance, identity correlation):
fit <- gllvmTMB(value ~ 0 + trait + indep(0 + trait | site),
                data = df, unit = "site")

# The mathematically-equivalent decomposition form:
fit <- gllvmTMB(value ~ 0 + trait + unique(0 + trait | site),
                data = df, unit = "site")

# ERROR: indep + latent on the same grouping is over-parameterised.
# gllvmTMB(value ~ 0 + trait +
#           indep(0 + trait | site) +
#           latent(0 + trait | site, d = 2), data = df)
} # }