我试图通过rpy2在Python中使用R&#39的fitdistr:
x = MASS.fitdistr(np.asarray(myValues), "beta", start=startParams)
但我收到了这条消息:
Error in optim(x = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, :
initial value in 'vmmin' is not finite
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/rpy2/robjects/functions.py", line 82, in __call__
return super(SignatureTranslatedFunction, self).__call__(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/rpy2/robjects/functions.py", line 34, in __call__
res = super(Function, self).__call__(*new_args, **new_kwargs)
rpy2.rinterface.RRuntimeError: Error in optim(x = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, :
initial value in 'vmmin' is not finite
现在,我的数组中没有NaN,但只是仔细检查我运行了这个:
numpy.isfinite(myValues)
...在数组的每个值上返回True
。
关于这里有什么问题的任何线索?