augmentPD: Augment Phylogenetic Diversity using MCEM

View source: R/simulation_augmentPD.R

augmentPDR Documentation

Augment Phylogenetic Diversity using MCEM

Description

This function performs augmentation of phylogenetic diversity (PD) on a given phylogenetic tree using the Monte Carlo Expectation-Maximization (MCEM) algorithm. It aims to estimate the maximum likelihood parameters for the given phylo object based on the provided parameters and constraints.

Usage

augmentPD(
  phylo,
  pars,
  maxN,
  max_missing,
  lower_bound,
  upper_bound,
  num_threads = 1,
  sample_size = 1,
  soc = 2,
  xtol_rel = 1e-05,
  verbose = FALSE
)

Arguments

phylo

A phylogenetic tree of class 'phylo'.

pars

A numeric vector of initial parameters for the MCEM algorithm.

maxN

The maximum number of iterations for the MCEM algorithm.

max_missing

The maximum amount of missing data allowed.

lower_bound

The lower bound constraint for parameter optimization.

upper_bound

The upper bound constraint for parameter optimization.

num_threads

The number of threads to be used for parallel computation. Defaults to 1.

sample_size

The size of the sample to be used in the MCEM algorithm. Defaults to 1.

soc

The second order correction for the MCEM algorithm. Defaults to 2.

xtol_rel

The relative tolerance for convergence in the optimization algorithm. Defaults to 0.00001.

verbose

A logical value indicating if progress messages should be printed. Defaults to FALSE.

Details

The function uses the branching.times function from the 'ape' package to calculate the branching times of the phylogenetic tree. It then calls a C++ function through the .Call interface for the MCEM algorithm. The parameters 'max_lambda', 'brts', and 'result' are used internally within the function.

Value

The result of the MCEM algorithm, which could be parameters estimates, log-likelihood values, or other relevant metrics depending on the implementation of the C++ function '_emphasis_rcpp_mce'.

Examples

## Not run: 
  data(bird.orders) # assuming bird.orders is a phylo object
  initial_pars <- c(0.1, 0.1)
  result <- augmentPD(phylo = bird.orders, pars = initial_pars, 
                      maxN = 1000, max_missing = 0.1, 
                      lower_bound = 0.001, upper_bound = 10)

## End(Not run)


franciscorichter/emphasis documentation built on Feb. 19, 2024, 7:36 p.m.