Export information about (internal) identifiability constraints


in several models identifiability is an issue, eg. models including population-level effects as well as group-level effects or tensor product interactions. To assure identifiability some constraints (e.g. sum to zero) are introduced internally in the estimation process.

How can I acces the information about these constraints after fitting a model?


One way might be to extract the Stan code underlying your model. Say you saved your brms model as fit1. You can extract the Stan code by executing fit1$model.

I can’t find any construction of constraint matrices in the Stan code. They might be constructed in R previously and then just transferred to Stan which seems reasonable since the constraint matrices for the semiparametric parts might be derived using mgcv functions internally.

Any idea how to access this information?

I’m tapped out on this one. Others?

I am unsure which constraints you are referring to exactly. Without more details, this question is a bit too broad for me to answer.

Two possible examples where identifiability constraints are needed are
(1) y ~ 1 + x1 + (1 + x1 || id)
(2) y ~ 1 + x1 + x2 + s(x1, id, bs="fs") + s(x2, id, bs="fs")
where id is a grouping variable.

In the first case a sum-to-zero constraint on the group-level effects seems to be sufficient but in the second case additional constraints are needed to ensure identifiability.

Since the models can be estimated and I do not need to provide these constraints manually, they seem to be introduced internally.

My question is: How can I access information about the constraints which were internally applied to my model?

(1) has a soft sum to zero constraint via the hiararchical prior for the random effects.
(2) has a similar constraint on the non-linear parts of the spline (penalized splines) but none on its linear part. So I am surprised (2) works reasonable at all given that we effectively have the linear parts twice in the model (and brms does not impose penalization there by default).

Okay, I think your answer reveals a fundamental misunderstanding of mine. I assumed that brms would always find and apply the necessary constraints to make the model identifiable (e.g. based on orthogonality in function spaces).

If this is not the case, one needs to be much more careful when constructing the models.

1 Like