Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running "inlasloo" #66

Open
jcavieresg opened this issue Mar 27, 2025 · 3 comments
Open

Error running "inlasloo" #66

jcavieresg opened this issue Mar 27, 2025 · 3 comments

Comments

@jcavieresg
Copy link

Hi everyone!

I'm trying to run loo-cv for a spatial model using simulated data. I have been following the example from the INLAutils package (https://github.com/timcdlucas/INLAutils?tab=readme-ov-file#spatial-leave-one-out-cross-validation-sloo-cv) but I'm having this error:

\textttt{Error in if (class(mesh) != "inla.mesh") stop("unexpected class instead of inla.mesh class for the argument "mesh"") :
the condition has length > 1}

I would be grateful if you can help me!
Thanks,

@timcdlucas
Copy link
Owner

I wouldn't be surprised if this is because INLA has pulled lots of code out into fmesher. I'll try to have a look but might require quite an extensive rewrite of inlautils so it might not be quick.
Tim

@jcavieresg
Copy link
Author

Hi Tim

Yes, looking at class of the mesh created in my computer, it seems that it comes from the library "fmesher":

class(mesh)
[1] "fm_mesh_2d" "inla.mesh"

fm_mesh_2d object:
Manifold: R2
V / E / T: 37 / 87 / 51
Euler char.: 1
Constraints: 21 boundary edges (1 group: 0), 12 interior edges (1 group: 0)
Bounding box: (-3.777535, 6.812768) x (-3.589064, 2.869430) x (0,0)
Basis d.o.f.: 37

But also it is a inla.mesh object, so something could be there to help you (maybe?)...
Thanks for your help!

Best,

@timcdlucas
Copy link
Owner

timcdlucas commented Mar 27, 2025

Ah, I might just be able to switch class(mesh) != "inla.mesh" to inherits("inla.mesh"). The earlier version is bad coding anyway!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants