Hello!
I want to see the effect of partial pooling in the following data. However, each row corresponds to a sum of multiple lines for each of the states. Thus, states with less exposure represents less original rows (less weight). The last column “PurePremium” is the ratio I want to model (Cost/Exposure). I was thinking 2 options. 1) Model cost with Exposure as offset and weights. 2) Model ratio (Cost/Exposure) with Exposure as a weight.
My problem is either I do it directly, or even normalizing weights, the model does not converge. Summing up:

I don’t know what role play weights for partial pooling, I guess states with more exposure contributes more to the overall mean.

In which case we have to normalize weights and how that affects the estimation algorithm. It is noteworthy that the exposures are so high in this case so if the variance is divided by weights, should we model costs directly to put it in level?
state Cost Exposure PurePremium
398 AZ 427243576 1352274 315.9445
399 CA 209261012 429744 486.9434
400 CO 343279991 856492 400.7977
401 CT 164581024 335020 491.2573
402 FL 5244800741 13094660 400.5297
403 GA 4231860437 7924618 534.0144
404 IL 332640238 833802 398.9439
405 IN 657799052 1083470 607.1225
406 MD 232967856 580956 401.0077
407 MI 308049813 1153222 267.1210
408 MN 46624519 117468 396.9125
409 MO 601465340 1619952 371.2859
410 NV 116394232 341410 340.9222
411 NY 597147136 1044810 571.5366
412 OH 580629529 1479476 392.4562
413 OK 76540657 213862 357.8974
414 PA 690546185 2131986 323.8981
415 TX 3834934060 9140948 419.5335
416 UT 192174885 931374 206.3348
417 VA 218375023 458498 476.2835
418 WI 379522917 745888 508.8202
model_nopool < brms::brm(
Cost 
weights(Exposure) ~ state,
data = SplitStates_2015,
chains = 2,
iter = 20000,
family = Gamma(link=“log”),
prior = model_prior
control= options(list(max_treedepth = 15))
)
model_partialpool < brms::brm(
PurePremium 
weights(Exposure_norm) ~ (1 
state),
data = SplitStates_2015,
chains = 2,
iter = 40000,
family = Gamma(link=“log”),
prior = model_prior,
control= options(list(adapt_delta=0.95,max_treedepth = 15))
)