issues with pointedSDM function datasetOut?

23 views
Skip to first unread message

AEL

unread,
Jan 29, 2026, 5:33:53 PM (6 days ago) Jan 29
to R-inla discussion group
Hello, 
Has anyone had any issues getting the function datasetOut to work lately? I think it's more user error....

I have a fitted model with shared spatial fields, and datasetOut gives this error message: Error in eval(predictor, envir = envir, enclos = enclos) : object 'shared_spatial' not found. Note in my model summary that shared spatial exists.

 I've minimized my model structure to address the issue but can't solve this. I can build a custom LOO CV but would sure like to get this function to work. 

Any tips?

Summary of 'modISDM' object:
inlabru version: 2.13.0 INLA version: 24.12.11 Types of data modelled: snowmachine_sf Count data aerial_sf Count data dslr_sf Present absence Time used: Pre = 0.523, Running = 0.65, Post = 0.165, Total = 1.34 Fixed effects: mean sd 0.025quant 0.5quant 0.975quant mode kld iceext 0.330 0.258 -0.176 0.330 0.836 0.330 0 sst -0.044 0.120 -0.279 -0.044 0.191 -0.044 0 dist_to_town_sq -0.259 0.542 -1.322 -0.259 0.804 -0.259 0 bathymetry 0.216 0.174 -0.125 0.216 0.557 0.216 0 tri -0.006 0.070 -0.143 -0.006 0.132 -0.006 0 wind 0.300 0.220 -0.131 0.300 0.731 0.300 0 snowext -0.431 0.167 -0.758 -0.431 -0.105 -0.431 0 snowmachine_sf_intercept -2.447 0.731 -3.880 -2.447 -1.014 -2.447 0 aerial_sf_intercept -1.553 0.685 -2.895 -1.553 -0.210 -1.553 0 dslr_sf_intercept 3.394 5.486 -7.357 3.394 14.146 3.394 0 Random effects: Name Model shared_spatial SPDE2 model Model hyperparameters: mean sd 0.025quant 0.5quant 0.975quant mode Range for shared_spatial 2.133 1.288 0.705 1.807 5.534 1.33 Stdev for shared_spatial 0.376 0.132 0.187 0.353 0.702 0.31 Marginal log-Likelihood: -1457.92 is computed Posterior summaries for the linear predictor and the fitted values are computed (Posterior marginals needs also 'control.compute=list(return.marginals.predictor=TRUE)')

Finn Lindgren

unread,
Jan 29, 2026, 5:55:27 PM (6 days ago) Jan 29
to AEL, R-inla discussion group
What version of PointedSDMs? CRAN or github?

I'm not sure if the PointedSDMs developers are on this list, so you may need to contact them directly instead. But from a quick look at the PointedSDMs::datasetOut code I'm afraid they've made some _extremely_ brittle assumptions about internal inlabru data structures that will soon change to support new inlabru features (e.g. location/names and contents/data types of lhoods and effects). _Maybe_ the github version of their package works with the current github devel version of inlabru at the moment, so that may be worth a try for a temporary fix. (I helped them a while back with some issues, but haven't had time to review their entire code collection).

From first glance, I'm not sure how much I'll be able to help them fix the code to make it work more generally and into the future. inlabru has gained more functions meant for external packages that need read-only access to some internal data structures, but to modify the internal structures they will need to discuss what interfaces they actually need (and whether they can modify it to use existing features); internal bru_info data structure access is _not_ supported (I'm trying to introduce warnings in advance for major changes, but cannot anticipate all issues...).

PS. I'm always a bit worried whenever I hear point processes mentioned with LOO-CV in combination, as that is not a well defined concept. (there are well-defined _related_ concepts, but LOO-CV is _not_ defined for point process models, since one has to leave out parts of _space_, not individual "points").

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/bc69a563-bd8e-4e12-ba40-831e693718b5n%40googlegroups.com.


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

Bob O'Hara

unread,
Jan 30, 2026, 4:07:45 AM (6 days ago) Jan 30
to R-inla discussion group
I've created an issue on the PointedSDMs repo: https://github.com/PhilipMostert/PointedSDMs/issues/35, I suggest you follow up there. I'll give Philip a prod about this too.

On LOO-CV: to be clear this is leaving out one data set, not one observation. I certainly wouldn't suggest using it unthinkingly: there will be cases when it's ideal for cross-validation, but in others the main benefit is to see the effect of the data set. 

Bob

Philip Mostert

unread,
Jan 30, 2026, 6:41:27 AM (5 days ago) Jan 30
to R-inla discussion group
Could you please try with the latest Github release? Otherwise, would it be possible for you to share your script on the Github issue page, and then I could have a look?

Kind regards
Philip
Reply all
Reply to author
Forward
0 new messages