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

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

1 Like