Problem using the inla framework. #4
-
|
Dear David I am having some problems using your MetricGraph library. I am attaching a code that does a simple exercise of simulating points on a graph and the trying to estimate the results. I have used both the inlabru and INLA interface, but while the inlabru interface seems to work fine and manage to recover the right value for the parameters of the model the inla interface often fails giving the following error: *** inla.core.safe: The inla program failed, but will rerun in case better initial values may help. try=1/1 Error in inla.core.safe(formula = formula, family = family, contrasts = contrasts, : object 'Intercept' not found The inla programm failed and the maximum number of tries has been reached. This is strange as the Intercept is there and sometimes the code runs without errors if I just restart R and run it again. Moreover, the estimates from INLA and inlabru are quite different, in particular the range of the SPDE field is heavily underestimated bu the inla() function. This puzzles me as inlabru is just a wrapper around inla and I am not able to see where the two differ from each other. Have you ever experienced getting such an error when using the inla() function? And can you see something wrong in the code I am sending you? Thanks a lot for help Bests Sara PS: Here are my session.info() in case it might be useful
Matrix products: default locale: time zone: Europe/Oslo attached base packages: other attached packages: loaded via a namespace (and not attached): |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
Hi Sara, David sent me your codes and data from this example. The problem is that you did not provide the You should fit the model as: I see that you used our example from the vignette. I have no idea why it worked in our case, but I have updated there to avoid any problems like this in the future. |
Beta Was this translation helpful? Give feedback.
-
|
Dear Alexander
Thanks a lot!
I ‘ll correct my code then!
Sara
From: Alexandre B. Simas ***@***.***>
Date: Tuesday, 4 June 2024 at 09:15
To: davidbolin/MetricGraph ***@***.***>
Cc: Sara Martino ***@***.***>, Author ***@***.***>
Subject: Re: [davidbolin/MetricGraph] Problem using the inla framework. (Discussion #4)
Hi Sara,
David sent me your codes and data from this example.
The problem is that you did not provide the control.predictor to inla.
You should fit the model as:
spde_fit <- inla(f.s, data = data_stk, control.predictor=list(A=inla.stack.A(stk_dat)))
I see that you used our example from the vignette. I have no idea why it worked in our case, but I have updated there to avoid any problems like this in the future.
—
Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANIDL5MMDZXIGVYNRVBSGJTZFVSSJAVCNFSM6AAAAABIWFHFLOVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TMNJZHA3DE>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
closing as resolved. |
Beta Was this translation helpful? Give feedback.
Hi Sara,
David sent me your codes and data from this example.
The problem is that you did not provide the
control.predictorto inla.You should fit the model as:
I see that you used our example from the vignette. I have no idea why it worked in our case, but I have updated there to avoid any problems like this in the future.