Help combining different INLA packages to model mountainous terrain

31 views
Skip to first unread message

Chris Smith

unread,
Nov 29, 2025, 8:13:46 PMNov 29
to R-inla discussion group
  Dear R-INLA community
       First, thanks again for providing awesome tools for us ecologists dealing with spatial autocorrelation. I am a PhD student trying to run an SPDE model in highly mountainous terrain with a large lake (Lake Tahoe) in the middle. I am trying to get help on the combination of packages and model types to use. As I understand it, I have several options:

inlabru: makes model specification easier (but inlabru's spde.posterior() does not work for non-stationary models)
rSPDE: estimates the smoothness parameter
barrier model: models barriers more accurately than simply inserting a polygon "hole"
non-stationary models: Finn graciously provided code for modeling "slope" of the terrain              on the mesh (using kappa and tau), which should help dissasociate points close                 in space but far in elevation 2000m vs 3000m (which can be within 1km of each 
             other).

The objectives are to look at fixed effects on the occupancy of a small mammal (pika), and to plot the decline of the autocorrelation over distance/range (n=1000 data pts, study area = 150x60km).


Question 1: 
I am worried that using an SPDE barrier model (https://eliaskrainski.github.io/INLAspacetime/articles/web/barrierExample.html) will make specifying a covariates on kappa and tau quite difficult, as both are non-stationary models. I was thinking for this reason, to simply put a 'hole' in my study area for Lake Tahoe (the older method), as the correlation in steep terrain is of much higher concern. Does this seem reasonable? (I am still new to INLA;  https://becarioprecario.bitbucket.io/spde-gitbook/ch-intro.html#sec:mesh 

Question 2:
I was thinking of using rSPDE to estimate the smoothness parameter, while modeling slope as a covariate on kappa and tau. It seemed like estimating the smoothness parameter would be important in steep mountainous terrain. However, I ran a basic rSPDE model on my data, and nu = 0.7, which I believe means alpha= 1.7 or close to 2 or the default in INLA...so maybe rSPDE is not necessary?  I was unsure if rspde.result() could also be called to plot the autocorrelation over distance (range).  Any suggestions on this workflow?




I am still learning all of the different packages associated with INLA and their functions, and any help understanding how to best combine these for my mountainous system would be appreciated.

Thanks for any help you can provide,
Chris

Finn Lindgren

unread,
Nov 30, 2025, 10:07:36 AMNov 30
to Chris Smith, R-inla discussion group
Hi Chris,

For question 1, the barrier model is really just a specific special case of a non-stationary model.
The main difference between the implementation of inla.spde2.matern with non-stationary tau/kappa parameters and in barrier model implementations is that inla.spde2.matern uses per-mesh-vertex parameter values, and the barrier model implementations use per-triangle values, which makes "holes" work a bit better in the cases when the mesh edges are aligned with the edges of holes. So you can get a similar model with inla.spde2.matern by having a basis function that is the indicator for whether you're "inside the barrier", and wither let it estimate the effect of the "hole", or include it as a strong feature of the mean structure of the parameters (i.e. in the first column of B.tau and B.kappa). If the mesh has sufficient resolution, this should be very different from a barrier model.

For question 2 and non-stationary models, I'd just use alpha=2 and not estimate the smoothness.

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/b24de723-4042-463c-a273-29910ecd9285n%40googlegroups.com.


--
Finn Lindgren
email: finn.l...@gmail.com
Reply all
Reply to author
Forward
0 new messages