mrosol / Nonlincausality

Python package for Granger causality test with nonlinear forecasting methods.
MIT License
70 stars 13 forks source link

`run_nonlincausality` Arguments not filled #7

Open cloudy-sfu opened 11 months ago

cloudy-sfu commented 11 months ago

https://github.com/mrosol/Nonlincausality/blob/5d77e8f3e69f68f7901925e594648ebad1c350d6/nonlincausality/nonlincausality.py#L497-L499

The three argument is not aligned to the definition of run_nonlincausality and will cause the following issue:

TypeError: run_nonlincausality() missing 3 required positional arguments: 'verbose', 'plot', and 'functin_type'

Suggestion:

verbose=verbose,
plot=plot,
function_type='LSTM'

The same thing should be fixed in the definitions of other neural network types.

cloudy-sfu commented 11 months ago

The following issue is caused by the same problem, but the solution doesn't solve the problem essentially.

https://github.com/mrosol/Nonlincausality/issues/3#issue-1384838782 https://github.com/mrosol/Nonlincausality/issues/4#issue-1490097283

amml1 commented 8 months ago

The issue seems to come from the fact, that there are two arguments (x_val and z_val) defined in run_nonlincausality but not in run_nonlincausalityMLP or run_nonlincausalityLSTM, why you get this error for both functions. There is no description of the two arguments either in utils.py or run_nonlincausality.py. In run_nonlincausalityNN they are defined, but you get another error: X_val = x_val[lag:, 0] line 149 TypeError: list indices must be integers or slices, not tuple. The idea for this package is great, I hope the issue can be resolved.