问题描述
mRI_qb <- gam(ri ~ SE_score + s(deg,k=7) + s(gs,k=7) + TL + species + sex + season + year +
s(code,bs = 're') + s(station,bs = 're'),family=quasibinomial(),data=node_dat,na.action = "na.fail")
我在 MuMIn 上运行了 dredge 函数,即使使用 pdredge 函数也很慢。
# RI dredge very slow so using parallel processing
library (parallel)
library (sNow)
#make cluster - use 5 because have 6 cores,need one for other tasks
mycluster = makeCluster(5,type = "SOCK") ## also need sNow installed
#data must exported to the cluster - see 'details' https://rdrr.io/cran/MuMIn/man/pdredge.html
clusterExport(mycluster,"node_dat")
#required packages must be also loaded there
clusterEvalQ(mycluster,library(mgcv))
RI_dredge <- MuMIn::pdredge(mRI_qb,mycluster)
然而,8天后,它终于完成了。但是,我只有 logLik、AICc、delta 和 weight 列的 NA。
Technical analysis chart showing volume and net volume
我似乎无法找到为什么挖泥船会为这些列输出 NA,尤其是模型运行良好且没有错误时。
解决方法
这是因为您使用了 quasibinomial
族,它不给出对数似然,因此无法计算 AIC。您可以尝试使用 bam
而不是 gam
,因为这是一个如此大的数据集。