Learn R Programming

BMhyb (version 1.5.2)

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 the 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 hybridization 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. Study trait evolution on phylogenetic networks. Submitted.

Examples

Run this code
# NOT RUN {
	#number of nonhybrid species
	ntax.nonhybrid<-5
	#number of hybrid species
	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