Learn R Programming

BMhyd (version 1.2-8)

GetMeansModified: The species means for the network model

Description

This function returns the species mean for the network model. For the non hybrid species, it returns as a parameter $\mu$ and for hybrid species it returns $\mu+ \log \beta$.

Usage

GetMeansModified(x, phy, flow, actual.params)

Arguments

x
vector of the parameters: including rate of evolution $\sigma^2$, overall mean $\mu$, measurement error SE, hybrid vigor $\beta$, variation at the burst of hybridization $v_H$.
phy
a class of phylo tree.
flow
a flow struture of gene flow.
actual.params
The parameters that are related to the hybridzation including the hybrid vigor $\beta$ and variation at the burst of hybridization $v_H$.

Value

the species mean

References

Jhwueng D.C. and O'Meara B.C. 2015. Trait evolution on phylogenetic networks. Submitted.

Examples

Run this code
	#number of nonhybrd species
	ntax.nonhybrid<-5	
	#number of hybridspecies
	ntax.hybrid<-2
	#simulate 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)
    #set the parameter values
    sigma.sq <- 0.01;mu <- 1;SE <- 0;bt<-12;vh<-0
    par<-c(sigma.sq,mu,SE,bt,vh)
    names(par)<-c("sigma.sq","mu","SE","bt","vh")
    actual.params<-12
    names(actual.params)<-"bt"
	#calculate the species means
	GetMeansModified(par, network$phy, network$flow,actual.params)
	

Run the code above in your browser using DataLab