The leading minor of order 2 is not positive definite

644 views
Skip to first unread message

Wala Draidi Areed

unread,
Feb 23, 2023, 9:36:14 PM2/23/23
to nimble-users
Hi nimble user,

 I have encountered an error in the code, which I have attached. Despite initialising all the parameters, the error still persists. I was wondering if you had any suggestions on how to resolve this issue.

Thank you,
Wala

error in chol.default(model$Tau[getNodeFunctionIndexedInfo(INDEXEDNODEINFO_,  :
  the leading minor of order 2 is not positive definite
Error in chol.default(model$Tau[getNodeFunctionIndexedInfo(INDEXEDNODEINFO_,  :
  the leading minor of order 2 is not positive definite
  [Note] Cannot calculate logProb for node lifted_chol_oPTau_oBm_comma_1to6_comma_1to6_cB_cP_L8[1, 1:6, 1:6].




GAcentroidgcd.rds
Nimble_code_SSB.R
GAcentroids.rds

Chris Paciorek

unread,
Feb 24, 2023, 8:03:55 PM2/24/23
to Wala Draidi Areed, nimble-users
Hi Wala,

It looks like you are initializing the matrices in a way that they are not positive definite by setting all the entries to be the same. 

> chol(Tau[1,,])
Error in chol.default(Tau[1, , ]) :
  the leading minor of order 2 is not positive definite

You need to make sure that each of the 6x6 matrices is positive definite, and thereby a valid precision matrix. E.g., you could initialize each as a diagonal matrix.

-Chris

--
You received this message because you are subscribed to the Google Groups "nimble-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nimble-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nimble-users/69f96749-441a-4bc0-80b7-6a9ac6ee7c53n%40googlegroups.com.

Wala Draidi Areed

unread,
Feb 27, 2023, 6:03:46 PM2/27/23
to paci...@stat.berkeley.edu, nimble-users
Hi Chris,
Thanks for your help. It's working now.
Wala
Reply all
Reply to author
Forward
0 new messages