compute_mean_variance.simple: Compute moments of params_old

View source: R/E_step.R

compute_mean_variance.simpleR Documentation

Compute moments of params_old

Description

compute_mean_variance.simple computes the quantities needed to compute mean and variance matrix with parameters params_old.

Usage

compute_mean_variance.simple(
  phylo,
  times_shared,
  distances_phylo,
  process = c("BM", "OU", "rBM", "scOU"),
  params_old,
  masque_data = c(rep(TRUE, attr(params_old, "p_dim") * length(phylo$tip.label)),
    rep(FALSE, attr(params_old, "p_dim") * phylo$Nnode)),
  sim = NULL,
  U_tree = NULL,
  ...
)

Arguments

phylo

Input tree.

times_shared

(matrix) : times of shared ancestry, result of function compute_times_ca

distances_phylo

(matrix) : phylogenetic distance, result of function compute_dist_phy

process

a two letter string indicating the process to consider

params_old

a list of parameters to be used in the computations

Details

This function is used by functions compute_E.simple and compute_log_likelihood.simple.

Value

sim (list) : result of function simulate with the appropriate parameters

Sigma matrix of variance covariance, result of function compute_variance_covariance

Sigma_YY_chol_inv invert of Cholesky matrix of Sigma_YY: (Sigma_YY)^(-1) = tcrossprod(Sigma_YY_chol_inv)


pbastide/PhylogeneticEM documentation built on Feb. 12, 2024, 1:27 a.m.