[R] System is computationally singular error when using cholesky decompostion in MCMC

R. Michael Weylandt michael.weylandt at gmail.com
Tue Feb 21 03:33:23 CET 2012


For question 2, my personal favorite is options(error=recover) which
will let you take a look at all levels of the call stack as soon as an
error is signaled. The debug package on CRAN is popular but I've never
used it.

Michael

On Mon, Feb 20, 2012 at 7:18 PM, Shantanu MULLICK <b00295766 at essec.edu> wrote:
> Hello Everyone
>
> I have a MCMC loop to calculate a time varying hierarchical Bayesian
> structure.
>
> This requires me to use around 5-6 matrix inversions in the loop.
>
> I use cholesky and chol2inv for the matrix decomposition.
>
> Because of the data I am working with I am required to invert a 167 by 167
> matrix twice in one iteration.
>
> I need to run the iteration for 10000 times, but I get the error  "System
> is computationally singular"  after 5 iterations of the MCMC.
>
> Are there any "usual suspects", frequently occurring errors that I should
> pay attention to ? My code is 200 lines so I don't write it here.
>
> Naive question 1: Is it possible that the error is occurring for any other
> reason other than "matrix inversion" ?
>
> Naive question 2: Any suggestions on which debugging function (out of the
> many functions that R provides)  would be the best to detect the error
> given my programming setup. I haven't used any of the debugging functions
> in R yet - in the past have been able to debug by going through the code.
>
> Thanks a lot !
>
> Best
> Shantanu
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list