Skip to content

A quantile dependent method to calculate the correlation between two series.

License

Notifications You must be signed in to change notification settings

wangys96/Cross-Quantilogram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cross-Quantilogram

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.

Installation

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

Documents

The User Guide is a Jupyter Notebook where I introduced the APIs and research methodologies:

User Guide

To fully understand CQ and its methodology, you can refer to these papers:

Dependencies

  • Python 3
  • Numpy >= 1.16
  • Panadas >= 0.23
  • statsmodels >= 0.9
  • matplotlib >= 3.0.2

References

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.

Contacts

If you have any question or idea, please create issues or contact me:

About

A quantile dependent method to calculate the correlation between two series.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages