# Mathemathical notation for a brms model with a smooth term

Hi,

I’ve been struggling lately with the mathematical notation for a model with the s()term.

Say, I have a model  y ~ s(x), family = gaussian with

prior(normal(0, 1), class = Intercept)
prior(normal(0, 2)", class = "sds", resp="y")
prior(exponential(1), class = sigma)

How can I write down the deterministic part of the model and the prior for the smooth term?

I recommend this blog post on the equivalence between penalized smooths and random effects by @tjmahr: Random effects and penalized splines are the same thing - Higher Order Functions

It will give you some help regarding your question.

2 Likes

Not sure, but perhaps something like this in math notation?

\begin{eqnarray} y_i & \sim & \mathrm{Normal}(\mu_i, \sigma) \\ \mu_i & = & \alpha + s(x_i, \tau) \\ \alpha & \sim & \mathrm{Normal}(0,1) \\ \tau & \sim & \mathrm{Normal}^+(0,2) \\ \sigma & \sim & \mathrm{Exponential}(1) \end{eqnarray}

Note that I’ve put ^+ after \mathrm{Normal}^+ to show that it only takes positive values.

I’m a bit uncertain how \tau should be displayed, but I guess the above will let you explain it to the reader, i.e., as @paul.buerkner writes in the documentation ?set_prior:

each spline has its corresponding standard deviations modeling the variability within this term

3 Likes

I recommend looking at James Hodges’s work. The link above mentions a paper of his on random effects, but there is a lot more on his website that would help with notation, including course materials that go along with his book, Richly Parameterized Linear Models.

3 Likes