Different results on different computers?

654 views
Skip to first unread message

Cheryl Schultz

unread,
Oct 14, 2016, 2:12:25 AM10/14/16
to R-inla discussion group
Hi,

We are trying to run a model of the basic form below

model1 <- inla(Y ~ 1 + f(time, model='ar1') + f(site), family="zeroinflatednbinomial1", data= dataset,
                   control.compute = list( waic = TRUE))

We are running in R version 3.1.1 and just updated INLA on four computers (2 PCs and 2 Macs). When we run this model - we get four different sets of results. For example, the WAIC values can differ by almost 200 and the effective number of parameters by more than 30. Rerunning the models produces the same result on each computer, so the results don't vary run by run, just computer by computer. We also tried switching from the "stable" to the "testing" version of INLA, but the results still vary between computers as well as vary between the stable and testing version of INLA.

Do you have suggestions on how to troubleshoot why different computers produce different results?  

Thanks!

- Cheryl Schultz

INLA help

unread,
Oct 14, 2016, 3:24:33 AM10/14/16
to Cheryl Schultz, R-inla discussion group
Hi,

thanks for your email. I would suggest to use the latest version of R,
which is 3.3.1  for the moment, but I do not think this is the issue
here.

If the model is almost singular, then details might matter including
the OS you're running it on. The parallelization is something we cannot
control as it is controlled by the run-time system, and if we combine
this with an almost singular model, then numerically ''the mode can
depend on the initial value'', which is again the next initial value,
and there you go. 

There are a few strategies to resolve this

- you can turn of the paralellisation using inla(..., num.threads=1),
but this is not a good idea really.

- its always possible to ''rerun'' the model, which can make it more
numerically stable for difficult models, like

r = inla(....)
r = inla.rerun(r)

where the second run is much quicker than the first. 

- we can decrease the tolerance in the inner optimisation, with

inla(..., control.inla = list(tolerance = 1e-10))

say, which should also help.  you can also combine option 2 & 3. 

- using more informative priors is very effective, as a little more
regularisation really helps



Let me know how this goes, and if you still have problems, please send
me data/R-code so I can check here. 

Best wishes,
H
> -- 
> 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 post to this group, send email to r-inla-discussion-group@googlegr
> oups.com.
> Visit this group at https://groups.google.com/group/r-inla-discussion
> -group.
> For more options, visit https://groups.google.com/d/optout.

--
Håvard Rue
he...@r-inla.org

Marc

unread,
Oct 16, 2016, 2:28:49 PM10/16/16
to R-inla discussion group, cheryl...@gmail.com, he...@r-inla.org

Dear Havard and Cheryl,


I have more or less the same problem. With my office computer I obtain a lot of Hessian warnings  (For example *** WARNING *** Eigenvalue 2 of the Hessian is -0.183833 < 0), however with my home computer I have run the same syntax and it has not produced any warning.


Best,


Marc

INLA help

unread,
Oct 16, 2016, 4:20:18 PM10/16/16
to Marc, R-inla discussion group, cheryl...@gmail.com
On Sun, 2016-10-16 at 11:28 -0700, Marc wrote:
> Dear Havard and Cheryl,
>
> I have more or less the same problem. With my office computer I
> obtain a lot of Hessian warnings  (For example *** WARNING ***
> Eigenvalue 2 of the Hessian is -0.183833 < 0), however with my home
> computer I have run the same syntax and it has not produced any
> warning.


Hi

this warning says that the Hessian computed around the mode has the
wrong sign, meaning that (most likely) that the mode is note
sufficiently accurate. In these cases, then a

result = inla.rerun(result)

would in most cases solve it. 

Also results produced with this warning will be less accurate and
cannot be trusted in detail. 

Best
H

--
Håvard Rue
he...@r-inla.org
Reply all
Reply to author
Forward
0 new messages