Estimates shifts in both the optimal trait values (mean) and evolutionary variance along a phylogeny under an Ornstein-Uhlenbeck (OU) process, using an \(\ell_1\)-penalized optimization procedure. Optionally accounts for measurement error in the observed trait data.
get_mean_var_shifts(
Y,
tree,
alpha,
lambda1,
lambda2,
max.steps = 1000,
t = 0.01,
penalty = "L1",
thres = 0.01,
sigma2 = NULL,
measurement_error = FALSE
)
A list containing:
Indices of branches with detected shifts in optimal trait values (\(\beta \neq 0\)).
Indices of branches with detected shifts in evolutionary variance (\(\gamma \neq 0\)).
Estimated shift coefficients for optimal trait values.
Estimated shift coefficients for evolutionary variance.
Estimated base variance (\(\sigma^2\)) of the OU process.
Estimated intercept (root state).
Estimated measurement error variance (only returned if measurement_error = TRUE
).
A numeric vector of continuous trait values for the species at the tips of the tree.
A phylogenetic tree of class phylo
.
The selection strength parameter in the OU process.
Non-negative penalty for \(\beta\) (shifts in optimal trait values).
Non-negative penalty for \(\gamma\) (shifts in evolutionary variance).
Maximum number of optimization steps. Default is 1000.
Step size for the gradient-based updates. Default is 0.01.
Type of penalty to apply. Options are "L1"
(default) or "None"
.
Convergence threshold for the change in loss between steps. Default is 0.01.
Optional initial value for the base evolutionary variance. If NULL
, it is initialized to 1.
Logical. If TRUE
, the method estimates additional measurement error variance.