Deep Nonlinear Causality (deep-nonlinear-causality)
Author: Dr. Abdullah Mohammad Ghazi Al khatib
Department: Department of Banking and Financial Institutions
Faculty: Faculty of Administrative Sciences
Affiliation: Al-Sham Private University, Damascus, Syrian Arab Republic
Academic Email: abduall.kh.foas@aspu.edu.sy
Secondary Email: genius.275@hotmail.com
ORCID iD: https://orcid.org/0000-0002-1352-2348
GitHub: https://github.com/ABDULLAH-AL-KHATIB
Release Date: 17-08-2026
🔬 Overview
deep-nonlinear-causality is a high-performance scientific framework for discovering multivariate, non-linear Granger causality and conditional causality in complex dynamical systems.
Classical Granger causality relies on linear Vector Autoregressions (VAR), failing in systems with non-linear couplings, regime shifts, and threshold effects. This package provides a non-parametric, permutation-based causal inference engine using Deep Neural Networks and Gradient Boosted Decision Trees.
Core Capabilities:
- Multivariate Causal Inputs ($X \in \mathbb{R}^k$): Test joint causality of multiple coupled variables.
- Conditional Causality ($X \to Y \mid Z$): Control for external confounders $Z$ to eliminate spurious causality.
- Autocorrelation Preservation: Employs Circular Block Bootstrap to maintain serial correlation and avoid inflated Type-I errors.
- Restricted Model Caching: Fits the baseline model once per hypothesis test, speeding up computation by ~50%.
- Memory Engine: Automatic TensorFlow session clearing and garbage collection to prevent GPU/RAM memory leaks.
🧠 Supported Estimators
- Deep Learning: LSTM, GRU, 1D-CNN (Temporal Convolutional), MLP.
- Machine Learning: Random Forest, Gradient Boosting, XGBoost, LightGBM, Kernel Ridge.
📦 Installation
pip install deep-nonlinear-causality[all]
⚡ Quick Start Examples
1. Bivariate Nonlinear Causality Test
import numpy as np
from deepcausality import CausalityTest
# Generate coupled nonlinear series: X causes Y
n = 500
np.random.seed(42)
X = np.random.randn(n, 1)
Y = np.zeros(n)
for t in range(2, n):
Y[t] = 0.4 * Y[t-1] + 0.35 * (X[t-1, 0]**2) + np.random.normal(0, 0.05)
# Run Causality Test using MLP Neural Network
engine = CausalityTest(random_state=42)
result = engine.run_test(y=Y, x=X, lag=2, model_type='mlp', n_permutations=50)
print(f'Is Causal: {result["is_causal"]}')
print(f'Empirical p-value: {result["p_value"]:.4f}')
print(f'Relative Gain: {result["observed_statistic"]:.4f}')
2. Multivariate & Conditional Causality Test ($X \to Y \mid Z$)
from deepcausality import ConditionalCausalityTest
X = np.random.randn(n, 3) # 3 causal candidate series
Z = np.random.randn(n, 1) # 1 confounding series
cond_engine = ConditionalCausalityTest(random_state=42)
res = cond_engine.run_test(y=Y, x=X, z=Z, lag=2, model_type='lstm', n_permutations=30)
print(f'Conditional Causality Detected: {res["is_causal"]}')
🌍 Research Application Domains
- Banking, Finance & Econometrics: Volatility spillovers, systemic risk contagion, crypto-equity linkages.
- Neuroscience & Biomedicine: Effective brain connectivity from EEG/fMRI, epileptic seizure onset tracking.
- Climatology & Earth Sciences: Ocean-atmosphere teleconnections, emissions vs. climate anomaly couplings.
- Industrial IoT & Smart Grids: Fault propagation detection, predictive maintenance in aerospace turbines.
- Genomics: Gene Regulatory Network (GRN) reconstruction from longitudinal single-cell RNA-seq.
📚 Citation
If you use this package in your academic research, please cite it as follows:
@software{Alkhatib_deep_nonlinear_causality_2026,
author = {Al khatib, Abdullah Mohammad Ghazi},
title = {{deep-nonlinear-causality: Multivariate Nonlinear Granger Causality Detection with Deep Learning and Machine Learning}},
year = {2026},
publisher = {PyPI},
organization = {Department of Banking and Financial Institutions, Faculty of Administrative Sciences, Al-Sham Private University},
address = {Damascus, Syrian Arab Republic},
url = {https://github.com/ABDULLAH-AL-KHATIB/deep-nonlinear-causality},
orcid = {https://orcid.org/0000-0002-1352-2348},
version = {1.0.2}
}
📜 License
MIT License. Copyright (c) 2026 Dr. Abdullah Mohammad Ghazi Al khatib.
Metadata
Release files for deep-nonlinear-causality 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| deep_nonlinear_causality-1.0.2.tar.gz | 8.6 kB | Without provenance | Details for deep_nonlinear_causality-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| deep_nonlinear_causality-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for deep_nonlinear_causality-1.0.2-py3-none-any.whl |
Total release size: 18.0 kB
Release files / deep_nonlinear_causality-1.0.2.tar.gz
| Download URL | deep_nonlinear_causality-1.0.2.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e3fe9d7ee5c3020f2d242e4847a842945002f197a2518550e4cb594e8fa4f36b
|
|
BLAKE2b-256 checksum How to use checksums |
4a8592bdf6ed3fe8e6486b24d56bc1a366533cfeab26659dcd5db40605c7980e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / deep_nonlinear_causality-1.0.2-py3-none-any.whl
| Download URL | deep_nonlinear_causality-1.0.2-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19362b7b11cdaa7c8db577cc8afa0fe2c9a78ca11076ee1507b37ebc0b7da51a
|
|
BLAKE2b-256 checksum How to use checksums |
75eb57129946971c14d24a32ce669cf719c25183b57579a38a1f0514f4f259cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Security for deep-nonlinear-causality 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.