CausalDiscoveryToolbox icon indicating copy to clipboard operation
CausalDiscoveryToolbox copied to clipboard

ValueError when running VarLiNGAM

Open shisi-cc opened this issue 5 years ago • 1 comments

When I run VarLiNGAM on Finance dataset (http://www.skleinberg.org/data/FinanceCPT.tar.gz), I meet a ValueError. df_data = pd.read_csv(datafile) model = VarLiNGAM(lag=3) result = model.create_graph_from_data(df_data) The error is as follows

File "", line 1, in runfile('F:/work_python_d_2/TimeSeriesCausalDiscovery/VARLiNGAM/VARLiNGAM_Finance.py', wdir='F:/work_python_d_2/TimeSeriesCausalDiscovery/VARLiNGAM')

File "D:_work\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile execfile(filename, namespace)

File "D:_work\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "F:/work_python_d_2/TimeSeriesCausalDiscovery/VARLiNGAM/VARLiNGAM_Finance.py", line 31, in G = model.create_graph_from_data(df_data)

File "D:_work\Anaconda3\lib\site-packages\cdt\timeseries\graph\VARLiNGAM.py", line 75, in create_graph_from_data inst, lagged = self._run_varLiNGAM(data.values, verbose=self.verbose)

File "D:_work\Anaconda3\lib\site-packages\cdt\timeseries\graph\VARLiNGAM.py", line 109, in run_varLiNGAM Bhat = np.dot((Ident - Bo_), Mt_)

ValueError: shapes (25,25) and (75,25) not aligned: 25 (dim 1) != 75 (dim 0)

shisi-cc avatar Dec 10 '19 07:12 shisi-cc

Hi, The data might not be in the good format; Let's ask @koutrgor for more details;

diviyank avatar Dec 20 '19 11:12 diviyank