背景:我正在使用statsmodels开发一个程序,该程序适用于超过100个变量的27个arima模型(p,d,q = 0,1,2),并选择具有最低aic和统计上显着的AR统计量的模型/对于更完整的测试,MA系数和统计上显着的p值...
对于一个特定变量和一组特定参数,我得到了
LinAlgError: SVD did not converge
Run Code Online (Sandbox Code Playgroud)
对于复制,变量和失败的代码如下
rollrate =[0.3469842191781748,
0.9550689157572028,
0.48170862494888256,
0.15277985674197356,
0.46102487817508747,
0.32777706854320243,
0.5163787896482797,
0.01707716528127215,
0.015036662424309755,
0.2299825242910243,
0.03719773802216722,
0.24392098372995807,
0.1783587055969874,
0.6759904243574179,
0.1197617555878022,
0.04274682226635633,
0.27369984820298465,
0.18999355015483932,
0.2985208240580264,
0.2872064881442138,
1.0522764728046277,
0.3694114556631419,
0.09613536093441034,
0.6648215681632191,
0.3223120091564835,
0.9274048223872483,
0.2763221143255601,
0.4501460109958479,
0.2220472247972312,
0.3644512582291407,
0.7790042237519584,
0.3749145302678043,
1.2771681290160286,
0.6760112486224217,
0.5214358465170098,
0.84041997296269,
0.12054593136059581,
0.18900376737686622,
0.042561102427304424,
0.17189805124670604,
0.11383752243305952,
0.2687780002387387,
0.717538770963329,
0.26636160206108384,
0.04221743047344771,
0.3259506533106764,
0.20146525340606328,
0.4059344185647537,
0.07503287726465639,
0.3011594076817088,
0.1433563136989911,
0.14803562944375281,
0.23096999679467808,
0.31133672787599703,
0.2313639154827471,
0.30343086620083537,
0.4608439884577555,
0.19149827372467804,
0.2506814947310181,
1.008458195025946,
0.3776434264127751,
0.344728062930179,
0.2110402015365776,
0.26582041849423843,
1.1019000121595244,
0.0,
0.023068095385979804,
0.014256779894199491,
0.3209225608633755, …Run Code Online (Sandbox Code Playgroud) 对于典型的整数值p,d,q和号码的列表,rollRate下面的代码:
fit = statsmodels.api.tsa.ARIMA(rollRate, (p,d,q)).fit()
forecast = fit.predict(start=len(rollRate),
end = len(rollRate)+11,
typ = 'levels')
Run Code Online (Sandbox Code Playgroud)
产生一个我不明白的错误:
文件“C:...\Anaconda3\lib\site-packages\statsmodels\base\wrapper.py”,第 92 行,包装器返回 data.wrap_output(func(results, *args, **kwargs), how)
类型错误:predict() 得到了一个意外的关键字参数“typ”
我也成功地预测了其他列表变量,但是这个特定的列表给了我一个错误。当源代码说它可以时,为什么predict()不接受typ作为关键字参数的任何想法?
您如何在bokeh中创建多行图标题?...与https://github.com/bokeh/bokeh/issues/994相同的问题
是否已解决?
import bokeh.plotting as plt
plt.output_file("test.html")
plt.text(x=[1,2,3], y = [0,0,0], text=['hello\nworld!', 'hello\nworld!', 'hello\nworld!'], angle = 0)
plt.show()
Run Code Online (Sandbox Code Playgroud)
另外,标题文本字符串可以接受格式文本吗?
我正在使用 scipy 版本 0.19.0。我看到在 scipy\stats_continuous_distns 下,函数_norm_ppf包装了scipy.special.ndtri. 我的问题是,这使用什么实现以及为什么这么慢?
为了进行比较,我在 ASA 241 中创建了一个众所周知的逆 cdf 开源实现的 ac 扩展(“R8_NORMAL_01_CDF_INVERSE”)。您可以通过以下链接查看它的一个版本:http://people.sc.fsu.edu/~jburkardt/c_src/asa241/asa241.html
一些简单的基准测试显示 scipy 的版本几乎慢了 1000 倍:
import timeit
from scipy.stats import norm
from QSCoreExtensions import r8_normal_01_cdf_inverse # compiled extension
def a():
norm.ppf(.3456)
def b():
r8_normal_01_cdf_inverse(.3456)
print(timeit.timeit('a()', number=10000, globals=globals()))
print(timeit.timeit('b()', number=10000, globals=globals()))
Run Code Online (Sandbox Code Playgroud)
输出:
1.219758156838038
0.0021004953395136194
请注意,任何输入(不仅仅是 0.3456)都会产生类似的结果。另外,r8_normal_01_cdf_inverse 精度是 10**16 的 1 分之一,实际上比 scipy.stats.norm.ppf 更准确
如何在python 64位中使用32位MS访问驱动程序进行odbc连接?可以通过改变pypyodbc中的环境句柄或odbc常量,或者创建一个位转换文件来完成吗?
另一个想法(不确定是否可能):有没有办法在代码执行期间切换到 32 位 python.exe(仅当用户想要拉取访问数据库时)?本质上类似于...
if access api called and struct.calcsize("P") == 8:
open python 32bit interpreter and connect to 32bit driver
对所有解决方案开放...谢谢
是否有一个 python 包(statsmodels/scipy/pandas/etc...)具有用于在 python 中估计具有自回归误差的线性回归模型的系数的功能,例如下面的 SAS 实现?http://support.sas.com/documentation/cdl/en/etsug/63348/HTML/default/viewer.htm#etsug_autoreg_sect003.htm