问题
I understand that in the package statsmodel has many statistical functions that enable one to test for many issues including Breusch Godfrey Lagrange test as described here
However, as far as I am concerned this only do the job for univariate case and not the multivariate case.
For example, consider I have a 2 diminsional dataset say data
from statsmodels.tsa.api import VAR
import statsmodels.api as sm,statsmodels as sm1
data= np.random.random((108, 2))
Model=VAR(data)
results = Model.fit(1)
sm.stats.diagnostic.acorr_breusch_godfrey(results)
Output:
in acorr_breusch_godfrey(results, nlags, store)
501 nlags = int(nlags)
502
--> 503 x = np.concatenate((np.zeros(nlags), x))
504
505 #xdiff = np.diff(x)
ValueError: all the input arrays must have same number of dimensions
Hence, obviously, this only work for one dimensional, is anyone aware how to test for Breusch Godfrey in the multivariate setting?
来源:https://stackoverflow.com/questions/46302347/multivariate-breusch-godfrey-lagrange-multiplier-tests-in-python