find.mle_FPK {BBMV}  R Documentation 
Find the maximumlikelihood estimate of the FPK model.
find.mle_FPK(model, method = "NelderMead", init.optim = NULL, safe = F)
model 

method 
The optimization routine to be used: can be either "NelderMead" (the default) or "LBFGSB". See the documentation of the optim function for more details. From our experience, "NelderMead" seems to produce better results. 
init.optim 
A vector of initial values for model parameters to start the optimization algorithm. If left NULL (as is by default), the function chooses a reasonable starting point, but you might want to play around with it. 
safe 
If safe is set to TRUE, the function runs three different optimizations starting with different values of the rate of evolution (sigma). This can prove useful in difficult cases. Default to FALSE for a single optimization (which is quicker). 
A list with the following elements:
lnL 
the loglikelihood of the model 
aic 
the Akaike Information Criterion of the model 
k 
the number of parameters of the model 
par 
a list of the MLEs of model parameters 
par_fixed 
a list with the parameters that were fixed. This includes the bounds use to discretize the model and eventually some of the parameters describing the shape of the macroevolutionary landscape. 
root 
A table giving the probability density of the trait at the root of the tree. The first column gives all possible trait values on the discretized trait grid, and the second the probability density at each of these points. 
convergence 
Convergence code returned by optim. 0 indicates successful convergence. For other values see the help of the optim function. 
message 
Convergence message returned by optim. See the help of the optim function. 
tree 
the tree used as input 
trait 
the trait vector used as input 
Npts 
the number of points used to discretize trait space. 
F. C. Boucher
## Not run: # Simulate data: tree + continuous trait library(geiger) tree=sim.bdtree(stop='taxa',n=10) # tree with few tips for quick tests tree$edge.length=100*tree$edge.length/max(branching.times(tree)) # rescale the tree # Simulate trait evolving on a macroevolutionary landscape with two peaks of equal heights x=seq(from=1.5,to=1.5,length.out=100) bounds=c(min(x),max(x)) # the bounds we use for simulating # they are just here for technical purposes but are not reached V6=10*(x^40.5*(x^2)+0.*x) # this is the evolutionary potential: it has two wells TRAIT= Sim_FPK(tree,x0=0,V=V6,sigma=10,bounds=c(5, 5)) # fit the FPK model: ll_FPK4=lnL_FPK(tree,TRAIT,Npts=25,a=NULL,b=NULL,c=NULL) # the full model fit4=find.mle_FPK(model=ll_FPK4) ## End(Not run)