错误:“输入矩阵是奇异的”在回归计算过程中报告。

huangapple go评论77阅读模式
英文:

Error "The input matrix is singular" was reported during regression calculation

问题

在执行如下脚本中的回归计算时,报告了一个错误:“输入矩阵是奇异的”。

test =select * from tobeols where date =2021.05.31
X=columnNames(test)[3:]
XX=matrix(test[X])

ols(test.RET, XX, 1,2)

这里,X 包括市值因子“mv”、一个“gtjaAlpha”因子和行业虚拟变量。

当我对来自其他日期的数据进行回归分析时,没有报错。似乎这一天的数据和其他日期的数据没有区别。此外,当移除与这个日期“2021.05.31”相关的因子“mv”时,执行也成功。是否有人知道这个错误消息的原因?

英文:

When I performed regression calculation as shown in the following script, an error was reported: The input matrix is singular.

test =select * from tobeols where date =2021.05.31
X=columnNames(test)[3:]
XX=matrix(test[X])

ols(test.RET, XX, 1,2)

Here, X includes the market value factor ”mv”, one “gtjaAlpha” factor, and industry dummy variables.

When I used the same method for regression analysis on data from other dates, no error was reported. It seems that there is no difference between the data for this day and other dates. Additionally, when the factor "mv" with this date "2021.05.31" was removed, the execution was also successful. Does anyone know the reason for the error message?

答案1

得分: 1

目前,ols 不支持输入非满秩矩阵。请参考如何在 DolphinDB 中检查矩阵是否是满秩的?来确定 XX 是否是满秩矩阵。在下一个版本中,该函数将被改进以处理这种类型的矩阵。

英文:

Currently, ols does not support input of a matrix of non-full rank. Please refer to How to check if a matrix is full rank in DolphinDB? to determine whether the XX is a full-rank matrix. The function will be improved to handle this type of matrix in the next version.

huangapple
  • 本文由 发表于 2023年6月13日 13:49:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/76462000.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定