如何确定此错误消息的来源:mc():在100次迭代中未“收敛”

时间:2013-05-16 22:20:03

标签: python r rpy2 statistics

下面的代码是R和Python的混合,用于值列表中的determining the Outliers值。 当我运行此代码时:

#!/usr/bin/python
from rpy import * 
r.library("robustbase") 
listInput =  [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0016999999999999999, 0.0025999999999999999, 0.0086, 0.0095999999999999992, 0.012, 0.0132, 0.0149, 0.021700000000000001, 0.022700000000000001, 0.023300000000000001, 0.024799999999999999, 0.0263, 0.029100000000000001, 0.033000000000000002, 0.0424, 0.057099999999999998, 0.0625, 0.063299999999999995, 0.0654, 0.069900000000000004, 0.070599999999999996, 0.072999999999999995, 0.078, 0.085599999999999996, 0.085599999999999996, 0.086499999999999994, 0.088200000000000001, 0.088999999999999996, 0.091300000000000006, 0.092700000000000005, 0.092999999999999999, 0.097199999999999995, 0.099900000000000003, 0.1077, 0.1143, 0.1255, 0.128, 0.13009999999999999, 0.13159999999999999, 0.13270000000000001, 0.1333, 0.1351, 0.14369999999999999, 0.15060000000000001, 0.1547, 0.15529999999999999, 0.15740000000000001, 0.15870000000000001, 0.17630000000000001, 0.1799, 0.18179999999999999, 0.20660000000000001, 0.20930000000000001, 0.2152, 0.219, 0.22919999999999999, 0.22989999999999999, 0.23200000000000001, 0.23369999999999999, 0.23619999999999999, 0.2399, 0.2422, 0.24890000000000001, 0.2545, 0.255, 0.25519999999999998, 0.25990000000000002, 0.26050000000000001, 0.26400000000000001, 0.27489999999999998, 0.27739999999999998, 0.27800000000000002, 0.27889999999999998, 0.28310000000000002, 0.29220000000000002, 0.29470000000000002, 0.30120000000000002, 0.31119999999999998, 0.32829999999999998, 0.32890000000000003, 0.33119999999999999, 0.3347, 0.3407, 0.35310000000000002, 0.35580000000000001, 0.35980000000000001, 0.3705, 0.38009999999999999, 0.38569999999999999, 0.39389999999999997, 0.40060000000000001, 0.4108, 0.4173, 0.42859999999999998, 0.4289, 0.4294, 0.443, 0.44359999999999999, 0.4541, 0.47020000000000001, 0.49109999999999998, 0.5, 0.50449999999999995, 0.50749999999999995, 0.53769999999999996, 0.54779999999999995, 0.58220000000000005, 0.59089999999999998, 0.60070000000000001, 0.60360000000000003, 0.60970000000000002, 0.63070000000000004, 0.63390000000000002, 0.65880000000000005, 0.6653, 0.66620000000000001, 0.66669999999999996, 0.69120000000000004, 0.72240000000000004, 0.7399, 0.74629999999999996, 0.748, 0.76139999999999997, 0.76319999999999999, 0.76719999999999999, 0.79549999999999998, 0.80679999999999996, 0.8085, 0.81599999999999995, 0.82499999999999996, 0.84940000000000004, 0.85919999999999996, 0.8851, 0.8921, 0.89900000000000002, 0.92200000000000004, 0.92379999999999995, 0.95099999999999996, 0.96150000000000002, 0.96319999999999995, 0.96709999999999996, 0.9698, 0.97499999999999998, 0.97589999999999999, 0.98419999999999996, 0.99029999999999996, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] 

print len(listInput)

TupleInput = tuple(listInput)

print r("adjboxStats")(r.c(TupleInput), coef = 2.5, a = -4, b = 3, do_conf = True, do_out = True)

我收到此错误:

maximal number of iterations (100 =? 100) reached prematurely
Traceback (most recent call last):
  File "/home/kritani/r_python/stack.py", line 49, in <module>
    print r("adjboxStats")(r.c(TupleInput), coef = 2.5, a = -4, b = 3, do_conf = True, do_out = True)
rpy.RPy_RException: Error in mc.default(x, na.rm = TRUE) :
  mc(): not 'converged' in 100 iterations

当我将数字最小化到小于100 number时,它会起作用。

我卸载了R并重新安装了它,但它没有解决问题。我查看了herehere以及herehere,并没有一个明确有效的解决方案。

有谁知道为什么会这样?

谢谢你们,伙计们!

0 个答案:

没有答案