Description Usage Arguments Details Value References See Also Examples

View source: R/shift_configuration.R

Fits an OU model based on a given configuration

1 2 3 4 5 |

`tree` |
ultrametric tree of class phylo, with branch lengths, and edges in postorder. |

`Y` |
trait vector/matrix without missing entries. The row names of the data must be in the same order as the tip labels. |

`shift.configuration` |
shift positions, i.e. vector of indices of the edges where the shifts occur. |

`criterion` |
an information criterion (see Details). |

`root.model` |
model for the ancestral state at the root. |

`alpha.starting.value` |
optional starting value for the optimization of the phylogenetic adaptation rate. |

`alpha.upper` |
optional upper bound for the phylogenetic adaptation rate. The default value is log(2) over the minimum length of external branches, corresponding to a half life greater or equal to the minimum external branch length. |

`alpha.lower` |
optional lower bound for the phylogenetic adaptation rate. |

`l1ou.options` |
if provided, all the default values will be ignored. |

AICc gives the usual small-sample size modification of AIC. BIC gives the usual Bayesian information criterion, here penalizing each shift as 2 parameters. mBIC is the modified BIC proposed by Ho and Ané (2014). pBIC is the phylogenetic BIC for shifts proposed by Khabbazian et al. pBICess is a version of pBIC where the determinant term is replaced by a sum of the log of effective sample sizes (ESS), similar to the ESS proposed by Ané (2008).

an object of class l1ou similar to `estimate_shift_configuration`

.

Cécile Ané, 2008. "Analysis of comparative data with hierarchical autocorrelation". Annals of Applied Statistics 2(3):1078-1102.

Ho, L. S. T. and Ané, C. 2014. "Intrinsic inference difficulties for trait evolution with Ornstein-Uhlenbeck models". Methods in Ecology and Evolution. 5(11):1133-1146.

Mohammad Khabbazian, Ricardo Kriebel, Karl Rohe, and Cécile Ané (2016). "Fast and accurate detection of evolutionary shifts in Ornstein-Uhlenbeck models". Methods in Ecology and Evolution. doi:10.1111/2041-210X.12534

`estimate_shift_configuration`

`adjust_data`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ```
data(lizard.tree, lizard.traits)
lizard <- adjust_data(lizard.tree, lizard.traits[,1])
eModel <- estimate_shift_configuration(lizard$tree, lizard$Y)
### building l1ou object out of the second best score
eModel2 = fit_OU(eModel$tree, eModel$Y, eModel$profile$configurations[[2]],
l1ou.options=eModel$l1ou.options)
plot(eModel2)
### hypothesis testing
data("lizard.traits", "lizard.tree")
Y <- lizard.traits[,1:1]
tr <- lizard.tree
tr <- multi2di(tr)
tr <- reorder(tr, "postorder")
### visualizing the tree with the edge indeces
plot(tr)
edgelabels()
## place the shift position based on the hypothesis
shift.config <- c(116, 77)
hModel <- fit_OU(tr, Y, shift.config, criterion="AICc")
plot(hModel)
print(hModel)
``` |

khabbazian/l1ou documentation built on July 30, 2018, 12:05 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.