I have a model with an ordinal outcome (sratio family) with two crossed group effects plus a monotonic predictor and a factor covariate. The number of levels of the group effects are 112 and 491. The model has good Rhat, ESS and no warnings. The model object size is about 72 MB. I run the model with a memory allocation of 32 GB without difficulty
loo(object) yields a R crash. This is repeatable. I assume that this is a memory problem.
bprior <- prior(student_t(3, 0, 2.5), class = 'b')
fit0.brmsfit <- brm(
formula = as.ordered(Interventions) ~
mo(Risk) + Race + (1 | CensusTract) + (1 | AnonymousProvider),
data = CuratedPONV.df %>%
filter(ProviderCasesCount >= 50 & CensusTractCasesCount >= 25 & Anesthesia != 'MAC'),
family = sratio(),
prior = bprior,
iter = 2000,
cores = 8,
chains = 8
)
The data is PHI and can’t be shared.
I tried running the model with fewer iterations and received ESS warnings.
I can obtain a larger memory allocation with a batch job. Can memory requirements be calculated? How much will it take?
Is the function loo_subsample.brmsfit relevant for producing a loo object?
Nathan
Please also provide the following information in addition to your question:
- Operating System: Centos07
- brms Version: 2.17.0
- R: 4.1.1
Model output:
Family: sratio
Links: mu = logit; disc = identity
Formula: as.ordered(Interventions) ~ mo(Risk) + Race + (1 | CensusTract) + (1 | AnonymousProvider)
Data: CuratedPONV.df %>% filter(ProviderCasesCount >= 50 (Number of observations: 33073)
Draws: 8 chains, each with iter = 2000; warmup = 1000; thin = 1;
total post-warmup draws = 8000
Group-Level Effects:
~AnonymousProvider (Number of levels: 112)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 0.63 0.04 0.56 0.73 1.00 1079 2295
~CensusTract (Number of levels: 491)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 0.22 0.01 0.19 0.24 1.00 3540 5614
Population-Level Effects:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept[1] -4.24 0.16 -4.54 -3.93 1.00 1515 3296
Intercept[2] -2.97 0.15 -3.27 -2.66 1.00 1496 3170
Intercept[3] -1.26 0.15 -1.56 -0.95 1.00 1468 3398
Intercept[4] 0.57 0.15 0.26 0.87 1.00 1501 3070
Intercept[5] 0.77 0.16 0.46 1.09 1.00 1658 3466
Intercept[6] 3.63 0.40 2.91 4.48 1.00 6304 4891
RaceUnknown -0.13 0.04 -0.20 -0.06 1.00 11642 6694
RaceWhite 0.22 0.03 0.16 0.27 1.00 10865 6723
moRisk -0.52 0.05 -0.63 -0.43 1.00 3378 3914
Simplex Parameters:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
moRisk1[1] 0.24 0.04 0.17 0.31 1.00 3061 4114
moRisk1[2] 0.15 0.02 0.11 0.19 1.00 4250 4384
moRisk1[3] 0.02 0.01 0.00 0.03 1.00 7957 3760
moRisk1[4] 0.03 0.01 0.02 0.04 1.00 7316 6098
moRisk1[5] 0.06 0.01 0.04 0.09 1.00 5498 5180
moRisk1[6] 0.32 0.04 0.25 0.39 1.00 3687 4151
moRisk1[7] 0.18 0.08 0.03 0.32 1.00 3281 2923
Family Specific Parameters:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
disc 1.00 0.00 1.00 1.00 NA NA NA
Looking forward to your topic!