What prior/model formula should I use to account for heteroscedasticity?

I’ve scoured google for an answer to this, but haven’t found anything other than a possibly outdated reference saying specifying a heteroscedastic variance structure isn’t possible in brms.

I don’t have a specific problem I’m working on and this is more of a question of interest, but if it helps in providing a clear answer example can be given for the iris data set.

Thank you

1 Like

Maybe the block post of Matti Vuorre is helpful to you: https://vuorre.netlify.com/post/2017/how-to-compare-two-groups-with-robust-bayesian-estimation-using-r-stan-and-brms/

I should have been a little more clear, my apologies. I meant heteroscedasticity in the case of the variance in variable Y increasing as the value of a continuous predictor variable X increases.

I know the asymmetric laplace family to model different quantiles would be a good choice for this case, but was wondering if there’s an equivalent to the sandwich estimator. I did just find this this paper on the topic, so I hopefully can figure out how to instantiate this in brms, or learn how to write a little Stan code and do it directly in there. I just like toying around with different scenarios. I’m continually impressed with the flexibility of the Bayesian approach.

You could try something like

formula = bf(Y ~ X, sigma ~ X)

Please also see example 2 in https://arxiv.org/pdf/1705.11123.pdf

2 Likes

@paul.buerkner how would you do this but using a GLM with a logit link function?

Can you provide more context to your question please?

@paul.buerkner I am using a binomial multi-membership model with a logit link function. My response variable is male female association rate and my fixed effects are status of male (i.e., territorial or satellite), number of non-focal male associates of female ( from previous day), number of the males female associates from the previous day, date with a second degree polynomial function, because the study period was from the start to end of the breeding season. This is my formula:
brm(num|trials(denom) ~status*poly(date,2) + non-focal… + males female associates+(1|mm(male_id,female_id))

When looking ate the pearson residuals vs fitted values it shows heteroskedasticity. Also there is a warning that 14 values have a pareto-k > .7.

I believe the issue is due to there being more 0s in the predictors for the territorial then there are for the satellite category. So I want a model that assumes unequal variance for status.

You can try to use the beta_binomial family and then predict the precision parameter “phi” in the same way as is done wiht “sigma” in the example above.

@paul.buerkner Sorry I am not familiar with phi. Is it the same as sigma?

Also, I am using this test, but am still trying to follow the frequentist assumptions.

What would you suggest to check this? should I use Pearson’s residuals or deviance residuals? Or should I just look at the fit when I run the posterior predictive check, since its similar to deviance residuals?

Thanks Paul

@paul.buerkner So since in my model indivdiuals with a status of territorial have more zeros in both the male_degree and non-focal male associates of female would this model be an appropriate model to account for that: