error when looping many MCMCglmm runs
Dear list, I'm not quite sure if this is the right list for this, but I only get this issue when I am running MCMCglmm, so I post it here. I am wondering if anyone has come across this issue: I am experiencing some errors when running MCMCglmm in nested loops. I have three datasets and a set of model formulations for each. So I loop through the datasets (i) with nested loops (j) for each model formulation, and I store the results in a list for each dataset. I then save the workspace, and move onto the second dataset (i+1). The first time I noticed something strange was after the workspace is saved at the end of the ith iteration, and I read in the data for the i+1th dataset. Normally, I'd read in the names of the files using list.files() and do some regular expressions to select the right filename to read in, but in this case, the vector of filenames somehow became empty. If I do this manually, then there's nothing wrong. I thought maybe R was jumping ahead of itself so at the end of the ith loop I set it so that R sleeps for 1 second, which for some reason resolved this issue. Today, I noticed something different. I get an error with MCMCglmm stating that the mixed model was singular. I never get this when I run the same model on its own or even if inside a loop, if within a single dataset. It happened when I looped through different datasets. Is there some known issue about too many loops, and maybe something to do with memory use that corrupts MCMCglmm runs? Would setting R to sleep or removing R objects more frequently help resolve this issue? I can try these but every loop takes hours so debugging errors that only occur over multiple nested loops is painstakingly time consuming. Any suggestions or thoughts would be most appreciated. Many thanks, Manabu
Manabu Sakamoto, PhD manabu.sakamoto at gmail.com [[alternative HTML version deleted]]