[R-sig-eco] fitting multiple variance structures in gamm

Ivailo ubuntero.9161 at gmail.com
Thu Jan 5 11:59:27 CET 2012

On Thu, Jan 5, 2012 at 11:30 AM, Marc Taylor <marchtaylor at gmail.com> wrote:
> Dear r-sig-ecology group,
> I am trying to fit a variance structure to two different covariates at once
> using varComb (nlme package) in a gamm (mgcv package) model. When I fit the
> same type of variance structure to each covariate individually, soolutions
> were found and the improvements were significant. However the fitting of
> both covariates at once does not find a solution and results in an error.
> Does anyone have any suggestions for me? Below is an example from my script.
> Many thanks in advance,
> Marc
> I set up the combined variance structure in this way:
>> varstrComb <- varComb( varConstPower (form = ~  COV1 ),varConstPower
> (form = ~  COV2 ) )
> Then fit the model:
>> gamm(fmla, data=db, weights=varstrComb, method="REML")
> I receive the following Error message:
> "Error in solve.default(-val) :   Lapack routine dgesv: system is exactly
> singular"

Dear Marc,

as the error message says, it appears that the covariance matrix is
singular and.cannot be inverted. You should check your covariates to
see if one of these is not a function of the other.

UBUNTU: a person is a person through other persons.

More information about the R-sig-ecology mailing list