[Caic-commits] r78 - in pkg: . R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Oct 15 16:21:21 CEST 2008
Author: davidorme
Date: 2008-10-15 16:21:21 +0200 (Wed, 15 Oct 2008)
New Revision: 78
Modified:
pkg/DESCRIPTION
pkg/R/pglm.R
pkg/man/pglm.Rd
Log:
Correction of pglm logLik calculation (Thanks to Tony Wilson) and minor update of pglm documentation
Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION 2008-10-04 11:29:26 UTC (rev 77)
+++ pkg/DESCRIPTION 2008-10-15 14:21:21 UTC (rev 78)
@@ -1,7 +1,7 @@
Package: CAIC
Type: Package
Title: Comparative Analyses using Independent Contrasts
-Version: 1.0.4-72
+Version: 1.0.4-78
Date: 2008-10-01
Author: David Orme, Rob Freckleton, Gavin Thomas
Maintainer: David Orme <d.orme at imperial.ac.uk>
Modified: pkg/R/pglm.R
===================================================================
--- pkg/R/pglm.R 2008-10-04 11:29:26 UTC (rev 77)
+++ pkg/R/pglm.R 2008-10-15 14:21:21 UTC (rev 78)
@@ -489,7 +489,7 @@
logDetV <- determinant(Vmat, logarithm = TRUE)$modulus[1]
- logLikY <- -n / 2.0 * log( 2 * pi) - n / 2.0 * log(ll$s2) - logDetV / 2.0 - (n - 1 )/ 2.0
+ logLikY <- -n / 2.0 * log( 2 * pi) - n / 2.0 * log( (n - k) * ll$s2 / n) - logDetV / 2.0 - n / 2.0 # using ML estimate of variance - bug spot by Tony Wilson
RMS <- ll$s2
RSSQ <- ll$s2 * (n - k)
Modified: pkg/man/pglm.Rd
===================================================================
--- pkg/man/pglm.Rd 2008-10-04 11:29:26 UTC (rev 77)
+++ pkg/man/pglm.Rd 2008-10-15 14:21:21 UTC (rev 78)
@@ -49,6 +49,9 @@
\details{
This function fits a linear model controlling for the non-independence between cases resulting from phylogenetic structure in the data. The strength of the phylogenetic signal can be controlled by altering the parameter lambda, which scales the covariance between data points (the off-diagonals of \code{phylomat}, representing the amount of shared evolutionary history) as the product of this shared history and lambda. A lambda of 0 is equivalent to a standard linear model, with all shared phylogenetic history reduced to zero, and a lambda of 1 uses the original covariance matrix. The function \code{pglmEstLambda} identifies the maximum likelihood value of lambda for a given model formula and also tests, using a log likelihood ratio test, whether this model is significantly more likely than a lambda of 0 or 1.
+
+The implementation of the method is currently as described in Freckleton et al (2002). This section will be expanded to compare the results obtained in this implementation to that of Pagel's Continuous.
+
}
\section{Warning}{
The model is fitted using a data frame reduced to complete row cases to eliminate missing values. In order to ensure that the models fitted using different subsets of the data are comparable, the whole data frame \code{data} is reduced to complete cases. In the future, a scope argument may be provided to control this but at present the data frame should be reduced to only those variables used in the maximal model in order to avoid prevent redundant variables causing rows to be dropped unnecessarily.
@@ -83,7 +86,8 @@
\item{LamOptimised}{A logical indicating whether the fitted lambda has been optimised using \code{pglmEstLambda()}}
\item{namey}{The name of the y variable.}
}
-%\references{ ~put references to the literature/web site here ~ }
+\references{R. P. Freckleton, P. H. Harvey, and M. Pagel. Phylogenetic analysis and comparative data: A test and
+review of evidence. American Naturalist, 160:712–726, 2002.}
\author{Rob Freckleton; David Orme}
%\note{}
\seealso{\code{\link{profile.lambda}} }
More information about the Caic-commits
mailing list