aphylo_cv {aphylo}R Documentation

Leave-one-out Cross Validation

Description

This implements Leave-one-out cross-validation (LOO-CV) for trees of class aphylo and multiAphylo.

Usage

aphylo_cv(...)

## S3 method for class 'formula'
aphylo_cv(model, ...)

Arguments

...

Further arguments passed to the method.

model

As passed to aphylo_mcmc.

Details

For each observation in the dataset (either a single gene if of class aphylo, or an entire tree if of class multiAphylo), we restimate the model removing the observation and use the parameter estimates to make a prediction on it. The prediction is done using the function predict.aphylo_estimates with argument loo = TRUE.

Value

An object of class aphylo_cv with the following components:

Examples

# It takes about two minutes to run this example


  set.seed(123)
  atrees <- rmultiAphylo(10, 10, P = 1)

  cv_multi  <- aphylo_cv(atrees ~ mu_d + mu_s + Pi)
  cv_single <- aphylo_cv(atrees[[1]] ~ mu_d + mu_s + Pi)
  


[Package aphylo version 0.3-3 Index]