Hello,

I am running a PGLS analysis using the corMartins correlation structure in
nlme for a couple of trait pairs and over a posterior distribution of
trees. For some trait pairs, when I run corMartins using a value of 1 I get
the error:

> lm_str <- corMartins(1,phy=pruned)
> gls(as.formula(form),correlation = lm_str,data = red_dat,method="ML")

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

In some cases, when I set the value to very small, for example 0.0000001, I
can avoid this error and the alpha is estimated:

> lm_str <- corMartins(0.0000001,phy=pruned)
> gls(as.formula(form),correlation = lm_str,data = red_dat,method="ML")
Generalized least squares fit by maximum likelihood
  Model: as.formula(form)
  Data: red_dat
  Log-likelihood: 0.7025522

Coefficients:
(Intercept)        eggs
  1.9217024  -0.2086322

Correlation Structure: corMartins
 Formula: ~1
 Parameter estimate(s):
     alpha
0.06871277
Degrees of freedom: 15 total; 13 residual
Residual standard error: 0.2585763

However this is not the case for all trait pairs, and some fail even with
small values. I am wondering why it is the case, and if there is something
I can do to avoid this error in all cases?

I have seen other emails on the archives asking a similar question, though
I can't find a reply - if this has already been answered, could you please
point me in that direction.

Thanks for any help you can provide!

Sam Church
Extavour Lab, OEB, Harvard
chu...@g.harvard.edu

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to