I am attempting to compute a generalised additive mixed-effects model (GAMM) in Posit Cloud. I have the standard plan (i.e., 32 GB RAM and 8 CPUs). In the settings, I changed the project resources to allocate 32 GB RAM and 8 CPUs ... and my GAMM still didn't run, and it crashed the session. As soon as the model starts running, it eats up all the RAM (the icon at the top of the page turns red), and then crashes with the following error message:
"The previous R session was abnormally terminated due to an unexpected crash"
The data for the model has approx. 42k rows, and one of the random effects has approx. 22k levels, so I understand it takes quite a bit of RAM. What I don't understand is why the session is still crashing – does anyone have any insight on this issue?
Here is the model specification:
mod_full = bam(varietal_closeness ~
s(AdA_longitude, AdA_latitude, k = 30) +
age + gender + length_in_location +
s(id, bs = "re") +
s(AdA_place, bs = "re") +
s(variable_id, bs = "re"),
data = dat, family = "binomial",
nthreads = 3,
discrete = T)