Learn R Programming

BMhyd (version 1.2-8)

GenerateValues: Generate parameter values

Description

This function generate new parameter values

Usage

GenerateValues(par, lower, upper, max.tries=100, expand.prob=0, examined.max, examined.min)

Arguments

par
parameters of interest
lower
the actual lower bound for the parameters
upper
the actual upper bound for the parameters
max.tries
maximum number of attempts tp generate the parameter value. The default is set to 100.
expand.prob
a probability value to expand.
examined.max
the allowed maximum for the parameters values.
examined.min
the allowed minimum for the parameters values

Value

The generated parameter values.

Details

This function generates new parameter values using the uniform distribution with the interval $ (L, U )$ where for each of the parameter of interest, the lower bound of the interval is set to $ L=\max (lower, 0.9*examined.min )$ and the upper bound of the interval is set to $ U =\min (upper, 1.1*examined.max )$.

References

Jhwueng D.C. and O'Meara B.C. 2014. Studying trait evolution in hybrid species on phylogenetic networks. Submitted. Seber G.A.F., Salehi M.M. 2013. Adaptive sampling designs: Inference for spatial and clustered population. Springer.

Examples

Run this code
	#parameter of interests
	mu<-1;sigma.sq<-0.1;bt<-1;vH<-0;SE<-0
	#parameters of interest
	par<-c(mu,sigma.sq,bt,vH,SE)
	#the lower bound 
	lower=c(-2,0,-10,0,0)
	#the upper bound
	upper<-c(2,1,10,100,100)
	#the exmined minimum value
	examined.min<-c(-1.8,0.001,-9.8,0,0)
	#the examined maximum value
	examined.max<-c(1.90,1.1,10.2,100,100)
	#simulate points
	sim.points<-GenerateValues(par, lower, upper, max.tries=100, expand.prob=0, 
	examined.max, examined.min)
	names(sim.points)<-c("mu","sigma.sq","bt","vH","SE")
	#show result
	sim.points
	

Run the code above in your browser using DataLab