另外,我现在的问题是,我是否要在两个数组上回归,例如不等距和无序
x = np.array([0.1, 0.5, 2.0, 1.6, 2.8, 3.5, 0.9, 1.5])
y = np.array([0.22, 1.21, 4.19, 3.39, 5.85, 7.21, 2.0, 3.2])
在talib中使用LINEARREG函数应该怎么做?在
感谢truf指出的c代码链接,LINEARREG只处理euqal距离x数组,而只通过输入y数组进行回归(此处价格接近)。在
^{pr2}$还应该注意,输入numpy数组需要进行类型检查
dtype=np.float
与c中的“double”匹配
original question
我用TA-Lib来计算技术指标,但是我不明白LINEARREG函数只有一个输入数组(称为收盘价),通常做线性回归,我们需要两个数组x和y来回归,比如我们要回归收盘价。在
实数=LINEARREG(关闭,时间段=14)
您最好检查ta lib中此函数的代码: https://sourceforge.net/p/ta-lib/code/HEAD/tree/trunk/ta-lib/c/src/ta_func/ta_LINEARREG.c#l238
它包含以下解释:
看来你的收盘价将被视为y数组,x将是日数数组[1..14]。tau linearerg_SLOPE、TA_LINEARREG_ANGLE、TA_LINEARREG_INTERCEPT和TA_TSF是其他基于TA_LINEARREG的TA lib函数。在
相关问题 更多 >
编程相关推荐