Learn R Programming

BMhyb (version 1.5.2)

GetVModified: Variance covariance matrix for the network model

Description

A function returns the variance covariance function for the network model under the Brownian motion for trait evolution.

Usage

GetVModified(x, phy, flow, actual.params, measurement.error = NULL)

Arguments

x

vector of the parameters: including rate of evolution \(\sigma^2\), overall mean \(\mu\), measurement error SE, hybrid vigor \(\beta\), and variation at the burst of hybridization \(v_H\).

phy

a class of phylo tree.

flow

a struture of gene flow.

actual.params

The parameters that are related to the hybridization including the hybrid vigor \(\beta\) and variation at the burst of hybridization \(v_H\).

measurement.error

estimate or fixed (see details).

Value

the variance covariance matrix of size equal to the number of species on the tip of the phylogeny.

Details

This function calculates the variance covariance matrix under the network model. The function first read tree in phylo class and convert the variance covariance matrix use the Brownian motion model. It then uses the structure of the gene flow to identify the hybrid species, parents and the direction of the flow. The covariance of between the hybrid and non hybrid species is the weighted sum of the covariance from evolution along the tree plus evolution along the migration path. For more detail about the model description, please see Jhwueng and O'Meara 2016.

References

Jhwueng D.C. and O'Meara B.C. 2016. Study trait evolution on phylogenetic networks. Submitted.

Examples

Run this code
# NOT RUN {
	#set the number of non hybrid species
	ntax.nonhybrid<-4
	#set the number of hybrid species
	ntax.hybrid<-1
	#simulate a network
	network<-SimulateNetwork(ntax.nonhybrid=ntax.nonhybrid, ntax.hybrid=ntax.hybrid,
	flow.proportion=0.5, origin.type='clade', birth = 1, death = 0.5, sample.f = 0.5,
	tree.height = 1, allow.ghost=FALSE)
	#assign the parameter values
	sigma.sq <- 0.01;mu <- 1;SE <- 0
	#get the variance covariance matrix
	GetVModified(c(sigma.sq,mu,SE), network$phy, network$flow, "bt")
# }

Run the code above in your browser using DataLab