0

I'm running linear mixed model in nlme package.

control <- lmeControl(maxIter=100,opt = c("optim"))
lme(response ~ 0+factorA+covariate,random=~1|factorB,
               weights=varIdent(form= ~1|factorA),control=control),

And, it come an error as following.

Error in logLik.reStruct(object, conLin) :NA/NaN/Inf in foreign function call (arg 3)

Is it the same as the convergence error? or others?

Thanks

Zheyuan Li
  • 71,365
  • 17
  • 180
  • 248
Colin
  • 107
  • 2
  • 3
  • 5
  • 2
    sorry, but there's not nearly enough information provided to answer the question. Please post a reproducible example if possible ( http://tinyurl.com/reproducible-000 ), and at the very least more information on context. – Ben Bolker May 10 '13 at 18:49
  • I edit my original question. Thanks – Colin May 10 '13 at 18:52

1 Answers1

0

This isn't quite an answer, but the formatting would be horrible in a comment. (Will delete or edit later if the question gets resolved.)

I can't reproduce, so far. Here is a reproducible example:

set.seed(101)
d <- data.frame(covariate=runif(500),response=rnorm(500),
                factorA=factor(sample(1:5,size=500,replace=TRUE)),
                factorB=factor(sample(1:5,size=500,replace=TRUE)))
library("nlme")
control <- lmeControl(maxIter=100,opt = c("optim"))
m1 <- lme(response ~ 0+factorA+covariate,random=~1|factorB,
          weights=varIdent(form= ~1|factorA),control=control,
          data=d)

Since this works, it's hard to go farther.

It would be best if you can provide a reproducible example. Short of that, you can debug/help debug by setting options(error=recover) or debug(nlme:::logLik.reStruct). Once you get into the browser, you can try commands like

ls()
str(object)
str(conLin)
dput(object)
dput(conLin)

and provide the results as appropriate.

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453