熊猫滚动窗口回归ols精度

时间:2014-09-19 15:52:45

标签: python pandas scipy statsmodels

我看到pandas滚动窗口多元回归并没有给出非常精确的结果。测试版都有点关闭,因为我想因为它试图跑得快?有没有办法强迫它给出更准确的结果? (我根据Excel测试结果)

这是我的示例代码

testData = pd.DataFrame({'x0': (105.2827928,105.2865254,105.2860275,105.2868111,105.2867191,105.2941308,105.3040566,105.3175178,105.3249605,105.3319957,105.3343568,105.335711,105.3370348,105.3475904,105.3521867,105.354053,105.3460503,105.3524061,105.3495786,105.337429),
    'x1': (11084.46645,11085.25243,11085.14758,11085.31259,11085.29323,11086.85397,11088.94433,11091.77955,11093.34731,11094.82933,11095.32673,11095.61202,11095.8909,11098.11479,11099.08324,11099.47649,11097.79032,11099.12947,11098.53371,11095.97394),
    'y': (0.523565383,0.533596935,0.5284088,0.533871668,0.534186651,0.523456406,0.522441767,0.515393324,0.518692219,0.518244902,0.494972089,0.491874655,0.4812694,0.459134135,0.452782801,0.460237668,0.46330172,0.425602082,0.438262734,0.414538997)})

model = pd.ols(y=testData.y,x=testData[['x0','x1']],window=10)

我还创建了一个显示Excel测试版的Excel电子表格。 http://speedy.sh/nhHwy/pandasOlsIssue.xlsx

0 个答案:

没有答案