Hi Nick,

You can fix the value of alpha in corMartins:

corMartins(1, tree, fixed=TRUE)

You can try with different values to see which one gives the best fit.

Best,

Emmanuel
-----Original Message-----
From: Nicholas Mason <nicholas.albert.ma...@gmail.com>
Sender: r-sig-phylo-boun...@r-project.org
Date: Thu, 22 Mar 2012 12:57:59 
To: <r-sig-phylo@r-project.org>
Subject: [R-sig-phylo] Error with PGLS under OU model using corMartins

Dear Rsigphylo users,
I am having issues running PGLS (with nlme function gls()) under an OU model 
using the corMartins command from ape. I've included links to a reproducible 
example via my dropbox account below. 

Previous posts have been made about the same error I've encounter, but neither 
thread seems to have relevant replies or have resolved the issue. Apologies if 
I've missed something else from previous rsigphylo threads.
https://stat.ethz.ch/pipermail/r-sig-phylo/2011-January/000875.html
http://www.mail-archive.com/r-sig-phylo@r-project.org/msg00577.html

In short, the data set I've linked to will run gls() under a correlation 
structure as defined by corBrownian and corPagel but not corMartins. The 
following error is encountered with corMartins:

Error in recalc.corStruct(object[[i]], conLin) : 
  NA/NaN/Inf in foreign function call (arg 4)

Has anyone else experienced this issue or know how to resolve it? What does 
this message mean? This happens with each variable I examine, not just the 
example included here.

Thanks in advance for any help or answers provided.

Cheers,
Nick Mason

The R object below contains a list called sampledata. sampledata[[1]] is a data 
frame with tip values and sampledata[[2]] is the corresponding tree.

Link to R objects: http://db.tt/ablyDBt1
Link to Rscript via public dropbox: http://db.tt/tJ8jg0JQ

require(ape)
require(nlme)

load("sampledata.Rdata")

sampledata[[1]]->tipdata
sampledata[[2]]->tree

gls(TraitA~TraitB,data=tipdata,correlation=corMartins(1,tree))
gls(TraitA~TraitB,data=tipdata,correlation=corBrownian(1,tree))
gls(TraitA~TraitB,data=tipdata,correlation=corPagel(1,tree))
---------------------------------
Nicholas Albert Mason
MS Candidate, Burns Lab
http://kevinburnslab.com/
Department of Biology - EB Program
San Diego State University
5500 Campanile Drive
San Diego, CA 92182-4614
845-240-0649 (cell)
        [[alternative HTML version deleted]]

_______________________________________________
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
_______________________________________________
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo

Reply via email to