This is a Python3 implementation of econometric method Cross-Quantilogram
invented by Han et al.(2016).
The Cross-Quantilogram
(CQ) is a correlation statistics that measures the quantile dependence between two time series. It can test the hypothesis that one time series has no directional predictability to another. Stationary bootstrap method helps establish the asymptotic distribution for CQ statistics and other corresponding test statistics.
This repo includes:
Cross-Quantilogram
statistics;- Stationary Bootstrap method;
- Portmenteau test(Ljung-Box or Box-Pierce);
- APIs for 3 Typical CQ methodologies'.
- Matplotlib results plotting for 3 typical methods.
For python environment, I recommand you to install Anaconda 3 which already includes the linear algebra libs. If you want to install numpy
manually, for Windows+Intel user I recommanded Numpy+MKL (you can get it here)
To install Cross-Quantilogram
:
python setup.py install
then try:
import CrossQuantilogram as cq
The User Guide is a Jupyter Notebook where I introduced the APIs and research methodologies:
To fully understand CQ and its methodology, you can refer to these papers:
- The intraday directional predictability of large Australian stocks: A cross-quantilogram analysis
- Spillovers and Directional Predictability with a Cross-Quantilogram Analysis The Case of US and Chinese Agricultural Futures
- Directional predictability from stock market sector indices to gold: A cross-quantilogram analysis
- Does international oil volatility have directional predictability for stock returns Evidence from BRICS countries based on cross-quantilogram analysis
- Python 3
- Numpy >= 1.16
- Panadas >= 0.23
- statsmodels >= 0.9
- matplotlib >= 3.0.2
Han H, Linton O, Oka T, et al. The cross-quantilogram: measuring quantile dependence and testing directional predictability between time series[J]. Journal of Econometrics, 2016, 193(1): 251-270.
If you have any question or idea, please create issues or contact me:
- Email: [email protected]
- WeChat: 89516821