How to diagnose cause of singular matrices?

23 views
Skip to first unread message

JJ Hubbard

unread,
Aug 16, 2022, 1:15:20 PM8/16/22
to R-inla discussion group
I am fitting an AR model like so:

m1 <- inla(Y ~ 1 +

    # Autoregressive
    + f(time_step, model="ar",
        order=1,
        replicate=participant_f,
        values=1:max(df$time_step),
        hyper = hyper_participant_f,
        constr=FALSE
    )
           
    , data=df, family="gaussian"
    , control.inla=list(strategy="adaptive",  int.strategy="auto")
    , control.compute=list(return.marginals.predictor=TRUE, cpo=TRUE, waic=TRUE, dic=TRUE, config=TRUE)
    , verbose=TRUE
    )

But INLA is frequently crashing due to the Hessian becoming singular and all NaN. What is the procedure for investigating what makes this matrix so easy to become singular?

Thank you very much.

INLA help

unread,
Aug 16, 2022, 1:52:03 PM8/16/22
to JJ Hubbard, R-inla discussion group
Can you retry with adding

inla(…., inla.mode=‘experimental’)

From: r-inla-disc...@googlegroups.com <r-inla-disc...@googlegroups.com> on behalf of JJ Hubbard <jordanj...@gmail.com>
Sent: Tuesday, August 16, 2022 7:15:20 PM
To: R-inla discussion group <r-inla-disc...@googlegroups.com>
Subject: [r-inla] How to diagnose cause of singular matrices?
 
--
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 on the web, visit https://groups.google.com/d/msgid/r-inla-discussion-group/5e6486fb-0172-44f7-995a-b5f493520a9dn%40googlegroups.com.

JJ Hubbard

unread,
Aug 16, 2022, 1:54:58 PM8/16/22
to R-inla discussion group
I have been running in experimental mode. Switching from stable to testing version seems to have made a massive improvement.

INLA help

unread,
Aug 16, 2022, 2:04:38 PM8/16/22
to JJ Hubbard, R-inla discussion group
Add verbose=T and look at the parameter in the optimization.  I guess one of them go high.  The name of the parameters are given when Optimization starts 

Sent: Tuesday, August 16, 2022 7:54:58 PM

To: R-inla discussion group <r-inla-disc...@googlegroups.com>
Subject: Re: [r-inla] How to diagnose cause of singular matrices?
 
Reply all
Reply to author
Forward
Message has been deleted
0 new messages