These functions create likelihood profiles for branch length transformations in phylogenetic generalised least squares models and fit confidence intervals to estimated branch length parameters.
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 pgls.profile
plot(x, ...)
The 'pgls.profile' function returns a list containing:
Parameter values at which the likelihood has been calculated.
The likelihood value at each value.
The parameter being profiled.
The value of the other fixed parameters.
The name of the 'comparative.data' object used to fit the model.
The 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':
The maximum likelihood value of the parameter.
The values of the bounds on the parameter.
The p value of the likelihood at the bounds, given the ML value.
The values of the parameter at the confidence intervals.
The confidence interval value used.
A pgls
object.
A choice of which branch length transformation ('lambda', 'kappa' or 'delta') to use.
The number of points used to profile the likelihood
A p value used to add confidence intervals to a likelihood profile for a parameter.
A 'pgls.profile' object to plot.
Further arguments to plot functions.
David Orme
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.
pgls
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