INLA poisson model with many covaraites

9 views
Skip to first unread message

Alokesh Manna

unread,
Sep 22, 2025, 10:41:02 AM (24 hours ago) Sep 22
to R-inla discussion group
Hi INLA Group,

I was trying to model as follows:

For the i-th replicate and  time t, the count y_{i,t} can be modeled as 

y_{i,t} ~ Pois ( exp (f(time, rw1) + f(i, iid) + X'{i,s} \beta_{s} ) ), with \beta_{s} has a neighborhood structure generated by inla graph. Here we want to put a besag kernel for smoothing over \beta_{s}.

Generally, for besag we need to construct an ID for the locations s and implement besag. Here important to note that the covariates only depend on spatially, not temporally. The number of covariates is huge, for example, 700.

p.s. if we make id for each location s, and make it a dataframe in long format and try to implement, we say that y_{i,s,t} but actually the count only depends on i and t.

Can we implement such a model?


Finn Lindgren

unread,
Sep 22, 2025, 10:57:05 AM (23 hours ago) Sep 22
to R-inla discussion group
Hi Alokesh,

your pseudo-math/code model definition isn't sufficiently clear to tell what model you actually want.
Can you spell out the model more carefully (preferably in a way that doesn't involve pseudo-code, but instead proper maths?
(There are lots of possible models and most syntactically valid code corresponds to _some_ model, but to know if it is the _intended_ model one needs a clear model definition that doesn't involve the code).
Your initial statement doesn't have "s" as an index on "y" but your RHS expression does, in a way that leaves it "dangling".
I can't tell if you want some weighted sum over all possible s, or if each "i" has a specific associated value of "s", is beta a single spatial field, or a separate field for each covariate, or something entirely different, etc.

Finn

--
You received this message because you are subscribed to the Google Groups "R-inla discussion group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to r-inla-discussion...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/r-inla-discussion-group/2c469127-0101-473c-b9ff-696382fce496n%40googlegroups.com.


--
Finn Lindgren
email: finn.l...@gmail.com

Finn Lindgren

unread,
Sep 22, 2025, 11:12:11 AM (23 hours ago) Sep 22
to R-inla discussion group
To be more specific, it's the
  X'{i,s} \beta_{s}
formulation that is undefined. I have the feeling that you either intend some kind of sum over "s", _or_
that each i has an associated value that we could write as s_{i}, and that each covariate is spatial.
In that latter case, a more complete statement would be
where X_j(.) is the spatial function defining covariate nr j.

But since that expression could be replaced by
   \beta_{s_i} \sum_{j=1}^J X_j(s_i)
and the value of the sum pre-computed for each "i", I'm guessing that's _not_ what you intended.

Since your original statement is ambiguous, you need to spell out the details of it.

Finn

Finn Lindgren

unread,
Sep 22, 2025, 11:13:28 AM (23 hours ago) Sep 22
to R-inla discussion group
Sorry, missed one line in the middle. It should have said this:

"
In that latter case, a more complete statement would be
  \sum_{j=1}^J X_j(s_i) \beta_{s_i}
where X_j(.) is the spatial function defining covariate nr j.
"

Reply all
Reply to author
Forward
0 new messages