Dear INLA team,
I am fitting a marked LGCP using inlabru, where the point process models observation locations and the mark model is a binomial response.
The model includes cyclic random slopes across four tidal phases.
The mark model includes both:
point_field * beta_link (shared spatial field linking the point process and mark model),
mark_field_tide (tide-specific spatial residual field).
The model is run on an HPC cluster using Linux.
The model fits successfully with a coarser spatial mesh, but fails with a finer mesh (7–10 km resolution) with a singular matrix error.
The model runs reliably with the 15–20 km mesh but consistently fails with the 7–10 km mesh.
I am trying to understand whether this issue is due to numerical instability introduced by the finer mesh or a problem with the model specification.
The job runs on an HPC cluster (Linux) and fails with the following message:
The model is a marked LGCP fitted with bru().
Point processIs this singular matrix error most likely due to:
the much finer mesh resolution,
the combination of point_field * beta_link and mark_field_tide.
the number of cyclic slope terms relative to only four tide groups,
or another numerical issue related to the SPDE discretisation?
Are there recommended strategies to stabilise the model when refining the mesh (for example changes to mesh construction, priors, or simplifying the latent model structure)?
Many thanks for any guidance.
Morgane
--
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/c341b7f1-4046-4e10-b141-b7bb23ac2711n%40googlegroups.com.
Hi Finn,
Thank you again for your suggestions. I implemented the changes you recommended and the model now runs to completion, which is a clear improvement compared to before.
In particular, I:
st_coordinates() when constructing the mesh,fm_nonconvex_hull(),cutoff,The relevant parts of the workflow now look like this:
crs_km <- fm_crs(gan_m, units = "km")
gan_km <- fm_transform(gan_m, crs_km)
domain_km <- fm_transform(domain_m, crs_km)
outer_boundary <- fm_nonconvex_hull(domain_km2, 40)
mesh <- fm_mesh_2d_inla(
loc = gan_km,
boundary = list(domain_km2, outer_boundary),
max.edge = c(7, 10),
cutoff = 5,
crs = crs_km
)
spde <- inla.spde2.pcmatern(
mesh = mesh,
prior.range = c(150, 0.5),
prior.sigma = c(1, 0.05)
)
The component structure now follows the weighted formulation:
cmp <- ~ -1 +
point_field(geometry, model = spde) +I also tested the alternative mesh construction using a regular lattice (fm_hexagon_lattice(...)) instead of loc = gan_km.
In both mesh versions the model runs, but during fitting I repeatedly obtain the warning:
*** warning *** iterative process seems to diverge, 'vb.correction' is aborted
*** Please (re-)consider your model, priors, confounding, etc.
Given that the warning appears with both mesh constructions, I was wondering how you would interpret it. In particular:
How would you recommend addressing this warning?
Does it mainly indicate a numerical issue with the variational Bayes correction step, or could it suggest a more fundamental issue with the model specification?
If the model otherwise runs to completion, to what extent might this warning affect the reliability of the outputs (fixed effects, spatial fields, predictions, WAIC/DIC, etc.)?
Since the warning occurs with both loc = gan_km and the hexagonal lattice mesh, would your next step be to simplify the model structure (for example removing the tide-phase replication on mark_field_tide), or would you first reconsider priors or integration settings?
Many thanks again for your help — your previous suggestions already allowed the model to run successfully.
Best wishes,
Morgane
To view this discussion, visit https://groups.google.com/d/msgid/r-inla-discussion-group/CAHC4gzY_ubs9HoFYQrZGE2Z7i27DiMqDznzCPPFiQV2GqANVPg%40mail.gmail.com.