minimize.phylo.gaps.sd: Minimize diet gaps in an adjacency matrix based on prey...

Description Usage Arguments Value Examples

Description

Minimize diet gaps in an adjacency matrix based on prey phylogeny using steepest descent optimization

Usage

1
minimize.phylo.gaps.sd(adj, phy, verbose = FALSE)

Arguments

adj

an adjacency matrix of class 'matrix'

phy

a phylogenetic tree of class 'phylo'

verbose

a logical indicating whether or not the function should print out details of the status of the optimization process

Value

The function returns a list made up of four elements ('adj', 'phy.init', 'phy.optim', and 'gaps.optim'). 'adj' and 'phy.init' are the adjacency matrix and phylogenetic tree, respectively, that were passed to the function. 'phy.optim' is the rotated phylogeny that corresponds to the minimum number of gaps found, and 'gaps.optim' is the value of that minimum.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(eklof)
gaps.phylo <- minimize.phylo.gaps.sd(eklof$network, eklof$tree)

## Not run: 
# Load the sample data
data(eklof)

# Run 1000 optimizations
gaps.phylo <- lapply(1:1000, function(x)(minimize.phylo.gaps.sd(eklof$network, eklof$tree)))

Find the minimum from this sample
gaps.phylo <- gaps.phylo[[which.min(lapply(gaps.phylo,function(x)x$gaps.optim))]]

## End(Not run)

stoufferlab/phyloint documentation built on May 30, 2019, 7:23 p.m.