有人可以向我解释此错误消息的含义吗?
我有一个名为 hitandrun 的 MCMC 采样方法(在未完成的包https://github.com/davidkane9/kmatching中),它为我提供了一个矩阵列表,其中包含作为单个样本的多元输出的列,这里是它的一个例子:
> A = matrix(1, ncol = 3)
> b = 1
> ## gives me solutions of Ax = b (a.k.a x + y + z = 1)
> h = hitandrun(A,b, n=10, chains = 2)
> h
[[1]]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
[1,] 0.1804431 0.3340590 0.4195820 0.2061222 0.3591085 0.09984353 0.6707110 0.3926639 0.1283919
[2,] 0.6135745 0.4256909 0.3619727 0.2918238 0.5057426 0.81919629 0.2368842 0.1178713 0.2666737
[3,] 0.2059824 0.2402501 0.2184453 0.5020541 0.1351489 0.08096018 0.0924048 0.4894647 0.6049344
[,10]
[1,] 0.1322112
[2,] 0.4736057
[3,] 0.3941831
[[2]]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
[1,] 0.32883534 0.1284182 0.1735151 0.2005726 0.94511422 0.61653717 0.5130324 0.33228224 0.2088865
[2,] 0.65868549 0.3066952 0.5182009 0.3065610 0.01214334 0.07007548 0.1191157 0.01137002 0.3311197
[3,] 0.01247917 0.5648866 0.3082840 0.4928664 0.04274244 0.31338735 0.3678519 0.65634774 0.4599938
[,10]
[1,] 0.61412223
[2,] 0.32289039
[3,] 0.06298738
我想看看这个数据的 Gelman-Rubin 诊断,看看我需要把它稀释多少,但是当我把它放在函数中时,我得到一个模糊的错误,我不知道它是什么意思。这是:
> mclist = lapply(h, function(x) mcmc(t(x), thin = 5))
> gelman.diag(mclist)
Error in chol.default(W) :
the leading minor of order 1 is not positive definite
(我想现在是订单 1,但在订单 3 之前)有没有关于 SO 的 coda 专家?我试图调试它,但它把我带到了一个内部函数 La_chol ,我不知道从那里做什么。