INLA crashes with gam model

515 views
Skip to first unread message

Víctor Hugo Gutiérrez Vélez

unread,
Jun 2, 2014, 7:18:45 PM6/2/14
to r-inla-disc...@googlegroups.com
Dear all,

I am trying to implement the following basic gam model in INLA.
formula=response ~ f(covariate, model = "rw2")

mod = inla(formula, data=Data2,family=fam, verbose=TRUE,
control.fixed=list(prec.intercept=0.1),
control.predictor = list(compute=TRUE),
control.compute=list(dic=TRUE, cpo=TRUE))

I can run the model with no problem using gam {mgcv} but it crashes in INLA showing nothing else than the error below. I would appreciate any help. I attach the data here in case it is useful.

Thanks,

Victor.

Error in inla.inlaprogram.has.crashed() :
  The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output carefully.
  If this does help; please contact the developers at <he...@r-inla.org>.

Data.RData

INLA help

unread,
Jun 2, 2014, 11:08:51 PM6/2/14
to Víctor Hugo Gutiérrez Vélez, r-inla-disc...@googlegroups.com
Hi

the problem is due to different formulation of a spline in gam and inla.
inla uses all values of 'covariate' and create a discretized version of
an integrated wiener process, for which to many unique values makes it
slow(er) and to close values makes it numerical singular. yours satisfy
both:

> min(diff(unique(sort(Data$covariate))))
[1] 1.929295612e-10

> length(unique(Data$covariate))
[1] 56302


there is a function is 'fix' this, so using

response ~ f(inla.group(covariate), model="rw2")

will solve it; see ?inla.group for details.

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

Víctor Hugo Gutiérrez Vélez

unread,
Jun 5, 2014, 2:57:54 PM6/5/14
to r-inla-disc...@googlegroups.com, esca...@gmail.com, he...@r-inla.org
Thank you Håvard for your prompt and useful reply. That indeed addresses the problem.

Víctor Hugo Gutiérrez Vélez

unread,
Jun 5, 2014, 2:58:05 PM6/5/14
to r-inla-disc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages