Please also provide the following information in addition to your question:

- Operating System: Ubuntu 16.04
- brms Version: 2.10

Im trying to migrate some models from lme() (nlme package) to brms and I have problems replicating the variance functions (variance function structures - varFunc) in lme(). Currently Im working with the varExp class: ‘defined as s2(v) = exp(2* t * v), where t is the variance function coefficient and v the covariate’, and I want v to be the fitted values (or y_i). I have found code to achieve group specific variances in brms (similar to the varIdent in lme), but I cant find much on exp and power functions on sigma. These are usually very useful for handling increasing variance (maybe there are better ways in brms?).

My best try so far is something like:

b = bf(y ~ x + (1|id),

sigma ~ y)

brm(b, data = dat, family=brmsfamily(“gaussian”, link_sigma = “log”)

This seems to replicate varExp(form=~y) in lme() pretty well (residual variance is extracted through exp(sigma_Intercept ), and sigma_y is the exp parameter (t) given by lme() ). But I dont think it is exactly correct (x2 is not there for example). Also, this is not using the fitted values (the default in lme).

Any input on how to correctly specify these variance functions (exp, power) in brms is welcome.

Thanks

Gustaf