Reconstruct ancestral embeddings under Brownian Motion (pure-R reference)
Source:R/reference.R
reconstruct_ancestral_bm_r.RdEstimates the root state with the GLS estimator and then computes the conditional expectation of every internal node. With `obs_sigma = 0` the resulting node estimates match `phytools::fastAnc`.
Arguments
- tree
A `phylo` object.
- z_obs
Numeric matrix (`S x D`) of observed tip embeddings.
- rate
Optional per-dimension BM rate. If `NULL`, estimated via ML under `obs_sigma = 0`.
- z_anc
Optional per-dimension root state. If `NULL`, estimated by GLS.
- obs_sigma
Observation noise sd added to the diagonal of the tip covariance matrix.