ar1c with replicate /group / etc

72 views
Skip to first unread message

Evan Baker

unread,
Mar 24, 2023, 9:53:23 AM3/24/23
to R-inla discussion group
Hi all,

I believe a similar question has been asked before, but wasn't answered.


Is it possible, either in inla itself, or using inlabru, to use replicate or group with ar1c.

I'm particularly interested in using something like a beslag model for the covariate (c) part in an ar1c.

In other words having the covariate effects in the ar innovations be different for different locations (or the same, and replicated for different locations)

Thanks,
Evan

Helpdesk (Haavard Rue)

unread,
Mar 25, 2023, 11:50:46 AM3/25/23
to Evan Baker, R-inla discussion group
I guess you can do it the other way around, ar1c grouped with besag ?
> --
> 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 on the web, visit
> https://groups.google.com/d/msgid/r-inla-discussion-group/6c4a8b0f-8691-4ce2-87dd-54b10e6f8a94n%40googlegroups.com
> .

--
Håvard Rue
he...@r-inla.org

Evan Baker

unread,
Mar 25, 2023, 1:44:10 PM3/25/23
to R-inla discussion group
Does that work? does that provide a different value for the covariate parameters for each group?

Helpdesk (Haavard Rue)

unread,
Mar 25, 2023, 1:53:29 PM3/25/23
to Evan Baker, R-inla discussion group
this is how I understand what you write. Can you check this out on some
simple simulated examples? If this is not, please come back to this
thread

Evan Baker

unread,
Mar 31, 2023, 10:22:44 AM3/31/23
to R-inla discussion group
Hi,

I've tried on a simulated toy example, and I'm still not fully sure of what's going on under the hood.

For one, I'm not fully sure where to get back the individual beta estimates for each locations. I think I've found it within summary.random, but there seems to be an awful lot of extra values in here, compared to just ar1 grouped.
Secondly, if I have found the beta estimates, they seem awfully uncertain, even tho they should be spatially correlated now, and the signal ive provided the model with is very clear and strong.
Thirdly, I'm still not sure what its doing under the hood. By grouping it this way, the ar1 process is correlated across space AND the Covariates in the ar1C bit are correlated across space?

Anyway, I've attached a toy example in R that should showcase this sort of model, and the issues I'm having. Any input would be super appreciated.
INLA_ar1c_besag.R

Helpdesk (Haavard Rue)

unread,
Mar 31, 2023, 1:59:52 PM3/31/23
to Evan Baker, R-inla discussion group
may I suggest a simpler model, as attached ? 

this use a AR1 + trend, instead of 'AR1 with trend'. The difference is
very subtel, but in your case its the same or very/almost the same. this
route is also easier to extend.
runme2.R

Evan Baker

unread,
Apr 3, 2023, 4:24:22 AM4/3/23
to R-inla discussion group
Thanks for doing this :)

Does this mean INLA  (as standard)  cannot handle hierarchies like the one I outlined?

For the specific potential work-around, I'm not sure if this workaround would work for the application we have in mind. We are mostly interested in how covariates affect the change at each timestep, and we would be looking to have the covariate induced growth decay over time if the covariate effect is taken away (aka, including the AR rho parameter), so it would be useful to have these covariates internal to the AR process.

If it ends up being too complex to have internal to the AR, how would the "AR with trend" work when the covariates aren't all fixed to be 1 as in this toy example?

Helpdesk (Haavard Rue)

unread,
Apr 3, 2023, 5:31:01 AM4/3/23
to Evan Baker, R-inla discussion group

its more the case that I think the ar1c is not what you want, and I
do not think its the right tool for what you want (as far as I
understand it).

it was initially ment for cases where the exceedance over a given
threshold had longer duration than expected and this was a way to
correct for that.

In the simulations you used a RW1, which kind of behaves differently
that the AR1 you used to estimate it back.

There is always the option to add your own model; see

inla.doc('rgeneric')
Reply all
Reply to author
Forward
0 new messages