Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inquiry about imposing a global cross-component sum-to-zero constraint on latent effects in INLA/inlabru #187

Open
XueqingYin opened this issue Mar 2, 2023 · 1 comment

Comments

@XueqingYin
Copy link

Hi,

We are working on a spatio-temporal model that contains 5 latent random effects, like:

formula = y ~ -1 + f(A1, model = SPDE1, group = ..) + f(A2, model = SPDE2, group = ..)+ f(A3 model = SPDE3 group = ..)+ f(A4, model = SPDE4, group = ..)+ f(A5, model = SPDE5, group = ..).

We would like to apply a sum-to-zero linear constraint across multiple effects, for example f(A1,…) + f(A2…)+ f(A3…) + f(A4…)=0. Comments from INLA discussion group indicated that this likely needs to be done by creating a "fake" zero observation, which is observed with fixed large observation precision. I tried this approach but got an error that appears to be memory issues. The error message has been attached here.

It would be beneficial to impose such a constraint for our analysis, so we are wondering if you have any ideas on how this could be fixed, or if the global cross-component constraint feature might be added into INLA/inlabru at some point later.

Many thanks in advance,

Xueqing Yin

error message

@finnlindgren
Copy link
Collaborator

finnlindgren commented Mar 2, 2023

The proper solution will be to implement joint constraints in R-INLA, so that one could specify e.g. a list of linear combination matrices list(comp1 = Acomp1, comp2=Acomp2, ...) and a vector e, that would define a joint set of linear constraints
$$\sum_k\mathbf{A}_k \mathbf{u}_k = \mathbf{e}$$ where $\mathbf{u}_k$ is the latent vector for component nr $k$.

In the inlabru interface, we then need to allow the user to specify such constraints in a similar or possibly identical way to how predictor expressions are specified with R expressions. It can then internally construct the needed matrices and e-vector to feed onwards to inla().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants