[R-sig-ME] afex package & bootstrapping

Daniel McCloy drmccloy at uw.edu
Tue Jul 5 22:59:20 CEST 2016


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

I'm using afex to get bootstrapped p-values. The model fit is quite
fast, but the bootstrapped p-values are taking forever and I wonder if
I'm doing something stupid.  Relevant details from the model summary:

Generalized linear mixed model fit by maximum likelihood (Laplace
Approximation) ['glmerMod']
Family: binomial  ( probit )
Formula: press ~ truth * revb * gend * attn + (1 | subj)
Number of obs: 20480, groups:  subj, 16

I set the script to use all 12 cores of my local machine and run over
the weekend:

library(afex)
library(parallel)
cl <- makeForkCluster(nnodes=12, outfile="cluster-log.txt")
form <- formula(press ~ truth*revb*gend*attn + (1|subj))
rev_mod <- mixed(form, data=revb_df, family=binomial(link="probit"),
                 method="PB", check.contrasts=FALSE, cl=cl,
                 args.test=list(nsim=1000, cl=cl, seed=1234, details=2),
                 control=glmerControl(optCtrl=list(maxfun=30000)))

After running for 3.5 days, all 12 cores are still maxed out, RAM usage
looks fine (around 16GB in use of the 32GB total), and the afex output
looks like this:

Fitting 16 (g)lmer() models.
Obtaining 15 p-values:
[Reference distribution with   996 samples; computing time: 159891.87 secs.
.

(the single period on the 4th line is part of the output).  The first 2
lines appeared before I left work on friday (i.e., within about 15
minutes of starting the script).  So presumably it has been working on
the p-values for the remaining 80+ hours.  I don't know exactly when the
"computing time" line appeared, but its estimate works out to about 44
hours...  is that just for the first of the 15 p-values, or for all of
them?  Is creating a cluster with all 12 cores a foolish idea?  (Am I
thereby strangling the multithreading abilities of some underlying
linalg library, effectively slowing things down?)  The dataset and
number of iterations just don't seem all that huge to me but maybe I'm
being naive.

- -- dan

Daniel McCloy
http://dan.mccloy.info
Postdoctoral Research Associate
Institute for Learning & Brain Sciences
University of Washington
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJXfB+cAAoJEEzlbMQqUVLOIuUH/Rb920Pcbedb6WaudG0KyifM
T3hQEALxFLyHttrbRAC1CrHgD4XClrTNQJGs3jcr+F23T/JYaR1jizFJ6SOBLi5i
niB+F5z2nD5yLsYSAHvvvfkcHTGCsFmUwp2tvThxYySAjehpzKzcm30ZSVcZH3qN
VpaWR0fBH3rmqwiUqE6IT3Nbt+wV9F2G/SK+wyX9waSwRN1SpiiCwQ1AIxU5s6SI
BSRL96nBLf93OLUgGZ22Lvu9w/AR7xNT6uNE2R9XdSMWF7/u+/eEgw/GVDWe+1l+
NYKN28qoynBeEagMfeZt+JCq6OG9yIWv4z6cE7EpPtTbxMqebrIQUrFU4uIGoAI=
=nuKw
-----END PGP SIGNATURE-----



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