![]() ![]() This near-zero matrix is now singular for some maximum lag number (>=5) and thus the test crashes. To do this an estimate of the parameters covariance matrix (which is then near-zero) and its inverse is needed (as you can also see in the line invcov = np.linalg.inv(cov_p) in the traceback). From the traceback, you can see, that internally a wald test is used to compute the maximum likelihood estimates for the parameters of the lag-time series. The problem arises due to the perfect correlation between the two series in your data. > 90 raise LinAlgError("Singular matrix")ĩ2 def _raise_linalgerror_nonposdef(err, flag): usr/local/lib/python3.5/dist-packages/numpy/linalg/linalg.py in _raise_linalgerror_singular(err, flag)Ĩ9 def _raise_linalgerror_singular(err, flag): I am trying to run grangercausalitytests on two time series: import numpy as npįrom import grangercausalitytests
0 Comments
Leave a Reply. |