admin管理员组

文章数量:1415673

I'm running a mixed model in mgcv::bam() and my most complex model is throwing the below error both on my PC (RStudio) & my work's high powered computing system running Linux. I think it's connected to the parallel computing options because it doesn't happen if I take out the nthreads = 12 - but then the model takes forever

Error in `pqr2()`:
! BLAS/LAPACK routine 'DGEMM ' gave error code -3
Backtrace:
 1. mgcv::bam(...)
 2. mgcv:::bam.fit(...)
 3. mgcv:::qr_update(...)
 4. mgcv:::pqr2(Xn, nt)

I can share my code but might struggle to give a MWE because it only happens in my biggest model.

# working model 8
F1.F.wigan.gamm8 <- bam(F2 ~
                  s(percent, k=4)  + #difference in height of traj
                  s(percent, by=age_ord, k=4) +
                  s(percent, by=sex_ord, k=4) +
                  s(percent, by=fol_ord, k = 4) +
                  s(percent, by=style_med, k=4) +
                  ti(percent, dur) + #interaction between shape and duration
                  s(percent, ID, bs="fs", xt="cr",m=1,k=4) + #random smooth
                  # s(percent, traj, bs="fs", xt="cr",m=1,k=4) #random smooth
                s(percent, word, bs="fs", xt="cr",m=1,k=4) #random smooth
               , data=data_F_wigan,method="fREML", nthreads = 12)

# working model 9 no parallel
F1.F.wigan.gamm8 <- bam(F2 ~
                  s(percent, k=4)  + #difference in height of traj
                  s(percent, by=age_ord, k=4) +
                  s(percent, by=sex_ord, k=4) +
                  s(percent, by=fol_ord, k = 4) +
                  s(percent, by=style_med, k=4) +
                  ti(percent, dur) + #interaction between shape and duration
                  s(percent, ID, bs="fs", xt="cr",m=1,k=4) + #random smooth
                  s(percent, traj, bs="fs", xt="cr",m=1,k=4) #random smooth
                s(percent, word, bs="fs", xt="cr",m=1,k=4) #random smooth
               , data=data_F_wigan,method="fREML")


# model causing error
F1.F.wigan.gamm8 <- bam(F2 ~
                  s(percent, k=4)  + #difference in height of traj
                  s(percent, by=age_ord, k=4) +
                  s(percent, by=sex_ord, k=4) +
                  s(percent, by=fol_ord, k = 4) +
                  s(percent, by=style_med, k=4) +
                  ti(percent, dur) + #interaction between shape and duration
                  s(percent, ID, bs="fs", xt="cr",m=1,k=4) + #random smooth
                  s(percent, traj, bs="fs", xt="cr",m=1,k=4) #random smooth
                s(percent, word, bs="fs", xt="cr",m=1,k=4) #random smooth
               , data=data_F_wigan,method="fREML", nthreads = 12)

Edit: on the suggestion of @Roland I have added main effects to the model not working - it's still throwing the same error

F1.F.wigan.gamm9 <- bam(F2 ~
                  age_ord +
                  sex_ord +
                  fol_ord +
                  style_med +
                  s(percent, k=4)  + #difference in height of traj
                  s(percent, by=age_ord, k=4) +
                  s(percent, by=sex_ord, k=4) +
                  s(percent, by=fol_ord, k = 4) +
                  s(percent, by=style_med, k=4) +
                  ti(percent, dur) + #interaction between shape and duration
                  s(percent, ID, bs="fs", xt="cr",m=1,k=4) + #random smooth
                  s(percent, traj, bs="fs", xt="cr",m=1,k=4) + #random smooth
                s(percent, word, bs="fs", xt="cr",m=1,k=4) #random smooth
               , data=data_F_wigan,method="fREML", nthreads = all_cores)

本文标签: