Thank you very much.

I'm currently writing a validation document for a SAS macro used in my company by comparing with lmer(). I was wondering if the cases when there are slight differences between SAS and R are the cases when the "G" matrix is not positive definite, that's essentially why I asked this question. Your answer is highlighting.

Thank you also for your other answer about the one-level random effect. You're absolutely right to say that SAS users are accustomed to ignoring large parts of the output. This output is nubearable. It is even worst when PROC MIXED is used in a heavy SAS "macro".

All the best,
Stéphane





________________________________
 De : Douglas Bates <bates@stat.wisc.edu>

Cc : "r-sig-mixed-models@r-project.org" <r-sig-mixed-models@r-project.org> 
Envoyé le : Jeudi 13 décembre 2012 0h36
Objet : Re: [R-sig-ME] matrix not positive definite with lmer()



wrote:

Hi,
>
> The lme() function returns a message when the G matrix is not positive definite (I do not remember where is this message but it is easy to find by exploring the output). There's no such message with lmer() ?
>

That's intentional.  The algorithm used in lme() to evaluate the log-likelihood or deviance fails when the variance-covariance matrix of the random effects (I think that is what the G matrix is, correct me if I am wrong as I don't speak SAS) is singular.  Considerable effort went into the development of the algorithm and model representation used in lmer() so that it can evaluate the deviance when this matrix is singular.  This allows us to set the lower bound of parameters that represent relative standard deviations as 0 instead of some arbitrary value that is close to zero but still positive.

It is useful to have this facility when optimizing the parameter estimates.  Do you bring this up because you want to be warned when the *estimated* variance-covariance matrix of the random effects is singular?  In most cases this is obvious if an estimated variance component is zero or if an estimated correlation for vector-valued random effects is -1 or 1.  However, vector-valued random effects of dimension greater than 2 can have singular variance-covariance matrices that display neither of these characteristics.  I have considered returning an estimate of the reciprocal of the condition number in those cases.  I suspect that in many cases where the dimension of the vector-valued random effect is, say, > 4, the estimated variance-covariance matrix is almost always singular. 

Returning a reciprocal condition number may be a way of stopping people from trying to fit such models,  Of course, it depends on their looking at the diagnostic and understanding that it means there is a problem but we can be optimistic and expect that this will happen.
	[[alternative HTML version deleted]]

