half normal and folded normal distributions in brms

894 views
Skip to first unread message

Chiara Gambi

unread,
May 7, 2017, 9:27:41 AM5/7/17
to brms-users
Hi there,

I am trying to model the absolute value of response variable that is (roughly) normally distributed. I am particularly interested in knowing whether the degree to which the response deviates from zero varies across values of a categorical predictor, hence why I am taking the absolute value.

I have two questions:

1. Is the folded normal distribution (which I understand is the most appropriate choice for my data) implemented in brms, or is there a plan to introduce it?

2. If the answer to 1 is negative, I thought of an alternative: I have centred my response variable so that it has mean zero prior to taking the absolute value. I think this should allow me to assume a special case of the folded normal, the half normal, which should be equivalent to a normal distribution truncated at a lower boundary of zero, as far as I understand.

I have then fit a truncated normal with formula

brmsformula(abs|trunc(lb=0) ~ 1 +CP1*CP2  + (1 +CP1*CP2 || Participant) +(1| Item))

where CP1 and CP2 are my categorical predictors, and

my_family = gaussian(link = "identity")

Any thoughts on whether this is a sensible approach to my problem?

I am currently using default priors and running into convergence issues. Any ideas on what an appropriate prior would be? I have never worked with truncated distributions before and am generally quite new to bayesian statistics, so apologies if none of this makes sense!

Many thanks,

Chiara




Paul Buerkner

unread,
May 7, 2017, 11:27:06 AM5/7/17
to brms-users
Hi Chiara,

your specification via trunc seems appropriate to me. What kind of convergence issues due you face?

Alternatively, you could use a family that can only take on positive values by default anyway, suche as lognormal, Gamma, or weibull.

Best,
Pauk

Chiara Gambi

unread,
May 8, 2017, 7:06:35 AM5/8/17
to brms-users
Hi Paul,

thank you very much for your quick reply. My gaussian models using trunc() returned divergent transitions, even after increasing adapt delta to .99 I thought that perhaps this was due to the limited number of observations by items (27-31), so I tried fitting a version without by-items random intercepts. This model failed to converge, returning a warning that the maximum treedepth had been exceed (but raising it from 10 to 15, as suggested in the STAN warnings help file did not help).

Thank you for your suggestion about using a different family. I have tried the lognormal and was able to fit a model successfully. Will keep exploring other distributions, but could you recommend a principled way of choosing amongst families? Can I compare models that were fitted using different families in terms of their fit, or is it inappropriate?

Many thanks again,

Chiara

Paul Buerkner

unread,
May 8, 2017, 7:19:23 AM5/8/17
to brms-users
Yes, comparing models fitted with different families via LOO or WAIC is reasonable as long as the families are either all discrete or all continuous (this is satisfied in your case).

I also suggest looking at the pp_check plots to see whether the models fit the data appropriately.

Best,
Paul

Chiara Gambi

unread,
May 8, 2017, 7:25:44 AM5/8/17
to brms-users
Thanks a lot, that is very helpful!

Chiara
Reply all
Reply to author
Forward
0 new messages