[R-sig-ME] glmer / MuMin : Error in asMethod(object) : not a positive definite matrix

Ben Bolker bbo|ker @end|ng |rom gm@||@com
Fri Aug 28 16:57:01 CEST 2020


    Great idea.  And, if you use parallel::mclapply (with appropriate 
use of clusterExport() to make sure the clusters have the objects they 
need in the environment), this can be done in parallel too ...

On 8/28/20 10:55 AM, Rafael Wüest wrote:
> Hi Guillaume
> 
> You can generate a list of calls by setting evaluate = FALSE in tdredge() and use the resulting list to run the models within a try(). You will just need to extract AIC (or whatever) yourself to rank models. But it should help to pinpoint models that fail.
> 
> Something like:
> 
> dlist <- dredge(mod_full_CC,rank="AICc",fixed=c("block","year"), evaluate = FALSE)
> AICs <- sapply(dlist, function(x) {
>    try(AICc(eval(x)))
> })
> 
> HTH,
> Rafi
> 
> 
>> On 28 Aug 2020, at 16:37, Ben Bolker <bbolker using gmail.com> wrote:
>>
>>    Pretty hard to debug without a reproducible example (and an 8-day run time isn't going to help ...)
>>
>>   The error message comes ultimately from the Matrix package (the error message is found in the "dspMatrix" → "dppMatrix" and "dsyMatrix" → "dpoMatrix" coercion methods).  If you run traceback() **immediately** after getting the error message, we might get a little bit more information.
>>
>>   What are the warnings?
>>
>> If you've got multiple cores, using pdredge() might decrease your run-time.
>>
>>   I don't know how to tell dredge() to use a try()-clause or equivalent to skip over models that have problems.
>>
>>
>>
>> On 8/28/20 8:40 AM, Guillaume Adeux wrote:
>>> Hello everyone,
>>> I am currently exploring the relationship between weed biomass during the
>>> fallow period and cover crop productivity (in interaction with tillage
>>> type, nitrogen fertilization, and cover crop species, as imposed by the
>>> 3-way factorial experimental design).
>>> This results in a highly complex model which I wish to reduce to achieve
>>> parsimony.
>>> Hence, I fitted the full model with glmer as:
>>> mod_full_CC=glmer(dry_bio_weeds_m2+0.001~
>>> *block+year*scale(dry_bio_cover_m2)*tillage*N*CC*
>>> +(1|block:tillage)+(1|block:tillage:N)+(1|block:tillage:N:CC)+(1|block:year)+(1|block:year:tillage)+(1|block:year:tillage:N)+(1|block:year:tillage:N:CC),family=gaussian(link="log"),control=glmerControl(optimizer="nloptwrap",optCtrl=list(algorithm="NLOPT_LN_NELDERMEAD")),data=biomassCC_wo_Cbis)
>>> and fed it to MuMin::dredge() as:
>>> options(na.action = "na.fail")
>>> dred_CC=dredge(mod_full_CC,rank="AICc",fixed=c("block","year"))
>>> However, I am unable to retrieve my "dred_CC" (after 8 days, arf) object
>>> because dredge() stops after returning:
>>> *Error in asMethod(object) : not a positive definite matrix*
>>> Is this due to a specific problem with one given model? If that's the case,
>>> how can I tell the function to simply skip it?
>>> To be completely transparent, it also states "In addition: There were 50 or
>>> more warnings (use warnings() to see the first 50)" but I don't believe the
>>> problem comes from there.
>>> I would greatly greatly appreciate it if someone could lend a hand.
>>> Thanks for your time.
>>> Guillaume ADEUX
>>> 	[[alternative HTML version deleted]]
>>> _______________________________________________
>>> R-sig-mixed-models using r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>>
>>
>> _______________________________________________
>> R-sig-mixed-models using r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> 
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>



More information about the R-sig-mixed-models mailing list