Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Survival Spatial Model Error

37 views
Skip to first unread message

A. Winter

unread,
Nov 21, 2024, 12:49:07 PM11/21/24
to R-inla discussion group
Hi colleagues,

We are attempting to fit a spatial survival model to estimate admin2- and age-specific time of school enrollment.  Admin2 represents the district in this country.

At the time of a cross-sectional survey we know the age of the individual and whether or not they have ever enrolled in school.  For some individuals we know the exact age of enrollment (uncensored), for others we know they enrolled some time in past (left censored) and for the rest we know they are not yet enrolled but could enroll in the future (right censored). From this left, right, and uncensored data,  we modified it to become interval or uncensored data (lines 5-18) in order to use the inla.surv() function.

I have attached the data and code below.  We have tried to fit these data using two different systems and received two different messages
1. "GMRFLib_2order_approx: rescue NAN/INF values in logl for idx=35312" for seemingly every single id in the dataset
2. "*** 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, : The inla program call crashed. The inla program failed and the maximum number of tries has been reached."

We would appreciate any help you can provide in fitting this model. Thank you!

4Forum.R
data4forum.RData

Helpdesk (Haavard Rue)

unread,
Nov 22, 2024, 5:07:46 AM11/22/24
to A. Winter, R-inla discussion group
The underlying reason is that the model does not fit well with the data, which
cause the issues.

What happens in practise is that the exponent in the likelihood-model, alpha,
goes nuts, and then numerical issues appear and the program fail to recover.

You can prevent alpha to move much, changing your 'control.family' into

control.family = list(variant = 1,
hyper = list(alpha = list(param = c(10^3, 10^3)))))


with this I get alpha=20 about, which is to me, crazy high.

Please check for possible data/model missmatch

Best
H

PS

please add 'scale.model=T' (see vignette about this)

f(spatial_id, model = "bym", scale.model = TRUE, graph = adj.matrix.113.csparse)
+ f(time, model="rw2", scale.model = TRUE)

and 'bym2' is a better choice than 'bym' (better priors and parameterisation)
> --
> 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/6ffa50b3-355d-4dbc-bf08-67aea0ef276en%40googlegroups.com
> .

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