I am creating a multillevel time-series model with stan and specifically with the brms package in R. When I use the brm function from this package making a model with only a individual-specific intercept and just one explanatory variable it works fine. However, I want to really understand the stan code so now I try to use the generated script from the brm function and run this using the stan function from rstan. Now the problems start, since when I run the model, the memory used by R in my computer increases dramatically and after just a couple of seconds I get the error that R can’t allocate a vector of just 23 kb. I have 16GB of RAM, so that’s not that small. My dataset contains 14638 observations. Does anyone know why I can’t run the generated script from brm but running the brm function works fine? Thanks in advance
Could it be that I insert the wrong data in the stan function. Because I am not sure whether some variables are what I think they are. But could that cause the memory issue or is that per definition not possible?