[R-sig-ME] Running

Jonathan Miller jwmille7 @ending from nc@u@edu
Fri Nov 9 22:15:53 CET 2018

Dr. Bolker,

I am a Phd student at NCSU and struggling with a coding issue. I am
bootstrapping some glmm model predictions in order to determine the
uncertainty associated with their fixed effects.  I read your comments on
https://github.com/lme4/lme4/issues/388 and have used a code similar to
yours below (b3):

## param, RE, and conditional
b1 <- bootMer(fm1,FUN=sfun1,nsim=100,seed=101)
## param and RE (no conditional)
b2 <- bootMer(fm1,FUN=sfun2,nsim=100,seed=101)
## param only
b3 <- bootMer(fm1,FUN=function(x) predict(x,newdata=test,re.form=~0),
              ## re.form=~0 is equivalent to use.u=FALSE

It has worked well for me but takes an extremely long time to run. I am
predicting 6 different wq indicators for 1,423 sites and the datasets range
in size from 3,000 to 25,000 entries each.  The small one is relatively
runs relatively ok, but the others are extremely slow. In my code (below),
I also want to make more than one prediction (current conditions, possible
future conditions) using the bootstrapping. Using "snow" in parallel
doesn't seem to speed things up.  I thought of two possibilities, but am
unsure how to implement them.

for (s in 1:1423){

bi <- bootMer(BI.mod,FUN=function(x)
bi.5 <- bootMer(BI.mod,FUN=function(x)

1) Can I predict the bootstrapped model using two different datasets at
once to speed things up (i.e., pred.sites and pred.sites.m5)?
2) Can I use parallel processing of the initial loop (1,423 sites) outside
of bootmer (perhaps with doParallel and foreach) and then run bootmer
within that loop?  Though I have used foreach before, I find it hard to
compile the data that I really want on the backend.

Thank you for your time and any suggestions you might have.



	[[alternative HTML version deleted]]

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