This is the documentation for the psytest package, a Python testing framework that applies the methodology of Phillips, Shi & Yu (2011) to test for the presence of multiple bubbles in a dataset.
A bubble is defined as a period of explosive growth above a unit root in the time series for a consistent period of time.
The main test in the package is the Backward Sup Augmented Dickey Fuller (BSADF) test of PSY. This test consists of applying the Augmented Dickey Fuller (ADF) test to an backward expanding window of the time series at each point in time to identify the presence of bubbles. A bubble is detected once this test rises above the critical value and ends when it returns to the region of non-rejection of the null hypothesis.
The benefits of this test relative to other tests in the literature is its ability to identify multiple bubbles in a dataset.
The main class of the package is the PSYBubbles class, which contains methods to calculate the BSADF test statistics and critical values as well as finding the start and end dates of the bubbles.
Check the documentation for more details on how to use the package and its methods.
Install the package from GitHub using pip:
pip install git+https://github.com/joseparreiras/psytest