Learn R Programming

caper (version 0.4)

pgls.profile: Likelihood profiles and confidence intervals for 'pgls' models.

Description

These functions create likelihood profiles for branch length transformations in phylogenetic generalised least squares models and fit confidence intervals to estimated branch length parameters.

Usage

pgls.profile(pgls, which = c("lambda", "kappa", "delta"), N = 50, param.CI = NULL)
pgls.confint(pgls, which=c('lambda','kappa','delta'), param.CI=0.95)
## S3 method for class 'pgls.profile':
plot(x, ...)

Arguments

pgls
A pgls object.
which
A choice of which branch length transformation ('lambda', 'kappa' or 'delta') to use.
N
The number of points used to profile the likelihood
param.CI
A p value used to add confidence intervals to a likelihood profile for a parameter.
x
A 'pgls.profile' object to plot.
...
Further arguments to plot functions.

Value

  • The 'pgls.profile' function returns a list containing:
  • xParameter values at which the likelihood has been calculated.
  • logLikThe likelihood value at each value.
  • whichThe parameter being profiled.
  • parsThe value of the other fixed parameters.
  • dnameThe name of the 'comparative.data' object used to fit the model.
  • formulaThe formula of the model being profiled
  • If the model contains an ML estimate of the parameter being profiled, then the 'pgls.profile' object will also contain the output of 'pgls.confint':
  • optThe maximum likelihood value of the parameter.
  • bounds.valThe values of the bounds on the parameter.
  • bounds.pThe p value of the likelihood at the bounds, given the ML value.
  • ci.valThe values of the parameter at the confidence intervals.
  • ciThe confidence interval value used.

Details

The 'pgls.profile' function calculates the likelihood of a 'pgls' model under different values of branch length transformations. A single parameter is chosen from 'lambda', 'kappa' or 'delta' to be profiled and the model likelihood is calculated at 'N' equally spaced points between the parameter bounds used in the model. If the model contains a maximum likelihood estimate of the parameter (or if param.CI is not null) then the resulting 'pgls.profile' object will contain estimated confidence intervals.

Only one parameter is profiled at a time and the other branch length parameters will be held at the fixed or ML estimates used to fit the model. The 'pgls.confint' function is used by either 'pgls' or 'pgls.profile' to find confidence intervals around a maximum likelihood estimate of a given branch length. The model must contain an ML estimate of the parameter for confidence intervals to be calculated.

The plot method simply draws an annotated profile plot, showing the location of the ML estimate and confidence intervals if present.

See Also

pgls

Examples

Run this code
data(shorebird)
shorebird <- comparative.data(shorebird.tree, shorebird.data, Species, vcv=TRUE, vcv.dim=3)
mod <- pgls(log(Egg.Mass) ~ log(M.Mass), shorebird, lambda='ML')
mod.l <- pgls.profile(mod, 'lambda')
plot(mod.l)
pgls.confint(mod, 'lambda')

Run the code above in your browser using DataLab