Uncertainty_FPK {BBMV}R Documentation

Parameter uncertainty

Description

This function plots likelihood profiles around the MLEs of paramaters and returns 95% confidence intervals.

Usage

Uncertainty_FPK(fit, tree, trait, Npts = 50, effort_uncertainty = 100, 
  scope_a = c(-10, 10), scope_b = c(-10, 10), scope_c = c(-10, 10))

Arguments

fit

An FPK model fit, as returned by find.mle_FPK.

tree

The phylogenetic tree.

trait

The named trait vector

Npts

The number of points used to discretize the trait interval.

effort_uncertainty

Determines the number of values at which the likelihood should be calculated for each parameter.

scope_a

Extreme values that should be investigated for parameter a.

scope_b

Extreme values that should be investigated for parameter b.

scope_c

Extreme values that should be investigated for parameter c.

Value

A list with 95% confidence intervals for all parameters.

Author(s)

F. C. Boucher

Examples

## 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: for technical purposes only
V6=10*(x^4-0.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)
# Measure uncertainty on model parameters
Uncertainty_FPK(fit=fit4,tree,trait=TRAIT,Npts=25,effort_uncertainty= 100,
  scope_a=c(-1,10),scope_b=c(-5,5),scope_c=c(-2,2))

## End(Not run)

[Package BBMV version 2.1 Index]