[R-sig-ME] glmer: var-cov estimated from RX

Ben Bolker bbolker at gmail.com
Mon Nov 30 02:18:08 CET 2015


On 15-11-28 05:06 PM, Hans Ekbrand wrote:
> Dear list,
> 
> I ran glmer() on a large dataset (16 million rows), and after some
> 6000 minutes, it converged.
> 
> However, there were two (related) warnings:
> 
> 1: In vcov.merMod(object, use.hessian = use.hessian) :
>   variance-covariance matrix computed from finite-difference Hessian is
> not positive definite: falling back to var-cov estimated from RX
> 2: In vcov.merMod(object, correlation = correlation, sigm = sig) :
>   variance-covariance matrix computed from finite-difference Hessian is
> not positive definite: falling back to var-cov estimated from RX
> 
> I seek advice on where to go from here, and knowledge about the
> concepts "MX" and "finite-difference Hessian" which I am unfamiliar
> with.
> 
> Can I rely on the variance-covariance matrix I've got?

  Probably.  These variance-covariance matrices are all approximations
in any case, but should be pretty good in the large-data case.

> 
> Should I try get rid of warning? If so, what could possibly help (is
> it meaningful to try with a different optimizer?)? Since the
> convergence time was about 5 days, trying out difference optimizers is
> not very fun.

  I suspect you probably won't be able to get rid of the warning, but it
may be worth trying out control=glmerControl(optimizer="bobyqa") --
might speed up your convergence considerably.

  It may also be worth trying the (experimental!!!) glmmTMB package,
which you can find on github ...

  cheers
    Ben Bolker

> 
> If it helps, here is the output of summary:
> 
> Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) ['glmerMod']
>  Family: binomial  ( logit )
> Formula: deprived.of.education ~ (1 | country) + (1 | lowest.regional.level) +  
>     per.cent.muslim.in.country * sex + per.cent.hindu.in.country *  
>     sex + per.cent.muslim.in.subregional.level * sex + per.cent.hindu.in.subregional.level *  
>     sex + gdp.log + qog + wealth * sex * religion + mean.wealth.at.lowest.regional.level
>    Data: my.df
> 
>      AIC      BIC   logLik deviance df.resid 
>  4047602  4048056 -2023770  4047540 16959894 
> 
> Scaled residuals: 
>     Min      1Q  Median      3Q     Max 
> -40.490   0.000   0.079   0.149   4.654 
> 
> Random effects:
>  Groups                Name        Variance Std.Dev.
>  lowest.regional.level (Intercept)  0.6495  0.8059  
>  country               (Intercept) 39.2973  6.2688  
> Number of obs: 16959925, groups:  lowest.regional.level, 3962; country, 31
> 
> Fixed effects:
>                                                Estimate Std. Error z value Pr(>|z|)    
> (Intercept)                                  -2.076e+01  1.150e+01   -1.81   0.0709 .  
> per.cent.muslim.in.country                    9.057e-01  7.431e-01    1.22   0.2229    
> sexMale                                       4.297e-02  5.193e-03    8.27  < 2e-16 ***
> per.cent.hindu.in.country                    -4.599e-02  3.366e-02   -1.37   0.1718    
> per.cent.muslim.in.subregional.level         -1.306e-02  9.290e-03   -1.41   0.1597    
> per.cent.hindu.in.subregional.level          -1.234e-02  1.059e-03  -11.64  < 2e-16 ***
> gdp.log                                       3.941e+00  1.548e+00    2.55   0.0109 *  
> qog                                          -5.200e+00  3.048e+00   -1.71   0.0880 .  
> wealthMiddle                                  1.166e+00  1.176e-02   99.10  < 2e-16 ***
> wealthRichest                                 1.584e+00  1.752e-02   90.38  < 2e-16 ***
> religionHinduism                             -9.585e-01  1.233e-01   -7.77 7.57e-15 ***
> religionIslam                                -3.983e-01  6.893e-03  -57.78  < 2e-16 ***
> mean.wealth.at.lowest.regional.level          1.258e+00  1.410e-01    8.93  < 2e-16 ***
> per.cent.muslim. in.country:sexMale           -2.692e-01  5.185e-03  -51.93  < 2e-16 ***
> sexMale:per.cent.hindu.in.country             3.684e-03  1.363e-04   27.03  < 2e-16 ***
> sexMale:per.cent.muslim.in.subregional.level -1.504e-03  1.399e-03   -1.07   0.2826    
> sexMale:per.cent.hindu.in.subregional.level  -1.350e-04  1.484e-04   -0.91   0.3632    
> sexMale:wealthMiddle                         -6.542e-02  1.414e-02   -4.63 3.72e-06 ***
> sexMale:wealthRichest                         1.553e-01  2.527e-02    6.15 7.99e-10 ***
> wealthMiddle:religionHinduism                -2.468e-02  1.409e-01   -0.18   0.8609    
> wealthRichest:religionHinduism                7.348e-01  1.472e-01    4.99 5.97e-07 ***
> wealthMiddle:religionIslam                   -2.575e-01  1.434e-02  -17.96  < 2e-16 ***
> wealthRichest:religionIslam                   1.183e-01  1.775e-02    6.66 2.70e-11 ***
> sexMale:religionHinduism                      3.811e-01  1.816e-01    2.10   0.0358 *  
> sexMale:religionIslam                         4.565e-02  9.674e-03    4.72 2.38e-06 ***
> sexMale:wealthMiddle:religionHinduism        -1.038e-01  2.020e-01   -0.51   0.6074    
> sexMale:wealthRichest:religionHinduism       -4.167e-01  2.117e-01   -1.97   0.0491 *  
> sexMale:wealthMiddle:religionIslam            1.257e-01  1.789e-02    7.03 2.07e-12 ***
> sexMale:wealthRichest:religionIslam          -1.642e-01  2.610e-02   -6.29 3.10e-10 ***
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> 
> 
> I can provide the data, it would help to understand the matter.
>



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