How to specify a scaled-t family in brms (R)?

Hi everyone !

I built a model with the gam function from MGCV using the scat family because my Y variable is heavily tailed (https://rdrr.io/cran/mgcv/man/scat.html). The residuals of the model are fine, and almost normal.

I tried to build the same model with brms but scat family is not implemented. So, I gave a try with the student family, but the residuals of the new model have a stronger kurtosis value. With 4000 observations, in a bayesian framework, is it a problem ?

I found that brms allows to specify custom families and a vignette explains the process : https://cran.r-project.org/web/packages/brms/vignettes/brms_customfamilies.html. Sadly, I am not able to fully understand it.
Does someone know how I could use it to specify the same scat family as in MGCV ?

Thank you a lot !

  • Operating System : windows 10
  • brms Version : 2.6.0

Are you sure that mgcv::scat does not implement that same family as brms::student? From the doc of mgcv they appear the same to me.

1 Like

Dear @paul.buerkner,

First, thank you a lot for your answer and your time !

So, I checked the brms vignette about distributions and the density function of the student family, but I couldn’t find the same thing for the mgcv::scat family. If you feel that they are the same, I trust you, but I have a little doubt about the “scaled” term in the mgcv family name. I tried to look at the source of the scat function but it’s a little bit messy.
There is this link https://www.rdocumentation.org/packages/metRology/versions/0.9-23-2/topics/Scaled%20t%20distribution, wich shows an other implementation of the scaled t distribution : “Student’s t distribution for ‘df’ degrees of freedom, shifted by ‘mean’ and scaled by ‘sd’

Yeah I am pretty sure they are the same. “scaled” is only special if you are used to standardized t-distributions for t-tests.

The t-distribution in Stan and brms are always scaled otherwise we couldn’t use them as drop-in replacements of the Normal distribution.

1 Like

Ok, thank you very much ! I’m just surprised to have so much differences in my residuals distribution, I have to inspect this to understand where the problem come from.