Skip to contents

Canonical name for T per-trait phylogenetic variances coupled by the phylo correlation matrix \(\mathbf A\); standalone = T univariate phylogenetic mixed models stacked.

Usage

phylo_indep(
  formula,
  tree = NULL,
  vcv = NULL,
  A = NULL,
  Ainv = NULL,
  common = FALSE
)

Arguments

formula

Intercept-only 0 + trait | species, or the supported one-covariate intercept-and-slope form described above.

tree

An ape::phylo object. Canonical.

vcv

A tip-only phylogenetic correlation matrix (n_species x n_species). Legacy alias of A =.

A

Tip-level relatedness matrix (n_species x n_species) – alias of vcv =, aligned with the animal_* family's argument naming.

Ainv

Sparse precision matrix (inverse of A).

common

FALSE (default) for a separate phylogenetic variance per trait; TRUE ties all traits to one shared phylogenetic variance (intercept-only). phylo_indep(0 + trait | species, common = TRUE) is the canonical one-shared-variance spelling and fits the same model as the soft-deprecated phylo_scalar(species).

Value

A formula marker; never evaluated.

Details

Each trait \(t\) gets its own variance \(\sigma^2_{\text{phy},t}\) on the same phylogenetic correlation matrix \(\mathbf A_{\text{phy}}\); trait-specific random vectors are otherwise independent.

$$\mathbf p_t \sim \mathcal{N}(\mathbf 0,\, \sigma^2_{\text{phy},t}\,\mathbf A_{\text{phy}}), \qquad t = 1, \dots, T.$$

Use phylo_indep() for an explicit marginal-only phylogenetic fit (no cross-trait phylogenetic decomposition). Use phylo_latent(..., unique = TRUE) for the paired phylogenetic decomposition \(\boldsymbol\Sigma_{\text{phy}} = \boldsymbol\Lambda_{\text{phy}}\boldsymbol\Lambda_{\text{phy}}^\top + \boldsymbol\Psi_{\text{phy}}\).

Mutual exclusion with phylo_latent()

Combining phylo_indep(0 + trait | species) with phylo_latent(species, d = K) is over-parameterised and the parser raises a cli::cli_abort().

Intercept-and-slope form

A single-covariate random regression uses phylo_indep(1 + x | species) in wide syntax or phylo_indep(0 + trait + (0 + trait):x | species) in explicit long syntax. It estimates an intercept–slope block with their correlation fixed to zero.

Pass the phylogeny via tree = phylo (canonical, sparse \(\mathbf{A}^{-1}\)) or vcv = Cphy ([Superseded], dense). See phylo_latent() for the full discussion of the two paths.

References

  • Williams et al. (2025) Phylogenetic generalised linear mixed models for multi-trait comparative analyses. bioRxiv 2025.12.20.695312. The marginal phylo_indep + indep standalone form stacked across traits matches their PGLMM Eq. 3.

Examples

if (FALSE) { # \dontrun{
library(ape)
tree <- rcoal(20); tree$tip.label <- paste0("sp", 1:20)
fit <- gllvmTMB(value ~ 0 + trait +
                  phylo_indep(0 + trait | species, tree = tree),
                data    = df,
                trait   = "trait",
                unit    = "species",
                cluster = "species")
} # }