Stan_glmer model's iterations is running slow

Hi,

I am running a stan_glmer model using a dataset. The model ran fine. However, after I recompiled it several times, the R session aborted. When I initiated a new session, the model is running super slow in both Rstudio and R. I tried to clear the environment and reinstall the rstanarm package, and restart laptop, but non of it worked. I am working on Mac OS system. I am wondering if anyone could point me in a direction on how to figure out where the problem lies? Thank you so much!!

Hi. What version of the Mac OS, R, RStudio, and rstan are you running on? Were there any error messages?

I don’t use a Mac but a number of folks here know how to troubleshoot.

Hi Ara,

Thank you for your reply! My Mac OS version is 10.14.6, R version is 4.0.3, RStudio version is 1.4.1103, and rstanarm version is 2.21.1. There is no error message when running the stan_glmer after it aborted the other time. Thank you for your help!

A quick bump. What happens when you run your data with just stan_lm ? And how big is your data set? And how many different levels are there?

thanks.

Hi Ara,

I am trying to implement a mixed effect model, and I am not sure how to implement it using stan_lm. I tried stan_lmer, and it still runs pretty slow. I am not sure if this will help, but I also wrote a model using rstan, and this model works fine.

I am using a toy dataset, with 2 levels and 24 observations in total. Thank you again for your help!

Can you post your full model call?

The model is : stan_glmer(y ~ individual + (individual + 1 | group), data = data, adapt_delta = 0.99,seed=1)

and my dataset is:
group individual y
1 V1 4.087463 0
2 V1 4.087463 0
3 V1 4.169925 0
4 V1 0.000000 1
5 V1 1.584963 1
6 V1 0.000000 1
7 V2 4.000000 0
8 V2 4.000000 0
9 V2 3.584963 0
10 V2 1.000000 1
11 V2 1.584963 1
12 V2 1.000000 1
13 V3 4.321928 0
14 V3 4.459432 0
15 V3 4.321928 0
16 V3 1.000000 1
17 V3 2.807355 1
18 V3 1.584963 1
19 V4 4.169925 0
20 V4 4.247928 0
21 V4 4.087463 0
22 V4 3.169925 1
23 V4 3.000000 1
24 V4 3.807355 1

Thank you!

1 Like