0
因此,我想對resudual做一個box-ljung測試,但我得到一個奇怪的錯誤,我無法弄清楚爲什麼。從statsmodel acorr_ljungbox錯誤
x = diag.acorr_ljungbox(np.random.random(20))
我試圖做同樣的用隨機陣列還,仍然是相同的錯誤:
ValueError: operands could not be broadcast together with shapes (19,) (40,)
你可以發佈周邊代碼 –
問題是因爲該函數默認使用lag = 40,並且數組比這更短。如果您明確設定延遲,則會解決該問題。請參閱下面的回答 –