SkillAgentSearch skills...

PyLiang

A causality test in climate

Install / Use

/learn @Koni2020/PyLiang
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Disclaimer

This module is based on routines provided by Sanxiang Liang at http://www.ncoads.cn/.

What is the pyLiang?

The liang-kleeman information flow causality test is used to detect causality between two time series. In a dynamic system, when information flow is transmitted between two entities in a specific way and often implies causality. Specifically, if the information flow rate between two time series events is close to zero, there is no causal relationship, vice versa.

Dependencies

For the installation of pyLiang, the following packages are required:

Installation

pyLiang can be installed using pip
pip install pyLiang

Usage

A quick example of pyLiang usage is as follow.

import numpy as np
from pyLiang import causality_est

# Data generation
ts1 = np.random.rand(360,1)
ts2 = np.random.rand(360,1)

res = causality_est(ts1, ts2)
print(res)

References

  1. San Liang X. Unraveling the cause-effect relation between time series[J]. Physical Review E, 2014, 90(5): 052150. doi:10.1103/PhysRevE.90.052150
  2. San Liang X. Normalizing the causality between time series[J]. Physical Review E, 2015, 92(2): 022126. doi:10.1103/PhysRevE.92.022126

Related Skills

View on GitHub
GitHub Stars7
CategoryDevelopment
Updated5mo ago
Forks0

Languages

Python

Security Score

82/100

Audited on Oct 31, 2025

No findings