Stationarity Test
A stationarity test is a statistical procedure that determines whether a time series has stable statistical properties over time. These tests are fundamental to time-series analysis, as many forecasting and modeling techniques require stationarity as a prerequisite.
Understanding stationarity
A time series is considered stationary when its statistical properties - such as mean, variance, and autocorrelation - remain constant over time. This property is crucial because:
- It allows meaningful statistical inference
- It enables reliable forecasting
- It supports the application of many time-series models
Types of stationarity
There are two main types of stationarity:
-
Strict (Strong) Stationarity
- The joint probability distribution remains unchanged when shifted in time
- All statistical moments must be constant
-
Weak (Covariance) Stationarity
- Mean remains constant
- Variance remains finite and constant
- Autocorrelation function depends only on time lag
Next generation time-series database
QuestDB is an open-source time-series database optimized for market and heavy industry data. Built from scratch in Java and C++, it offers high-throughput ingestion and fast SQL queries with time-series extensions.
Common stationarity tests
Dickey-Fuller Test
The Dickey-Fuller test is one of the most widely used stationarity tests. It tests the null hypothesis that a unit root is present in a time series sample. The basic test equation is:
Where:
- is the time series
- is the coefficient
- is the error term
Augmented Dickey-Fuller (ADF) Test
The ADF test extends the basic Dickey-Fuller test to handle more complex models:
Where:
- is the drift term
- is the time trend
- is the lag order
Next generation time-series database
QuestDB is an open-source time-series database optimized for market and heavy industry data. Built from scratch in Java and C++, it offers high-throughput ingestion and fast SQL queries with time-series extensions.
Applications in financial markets
Stationarity tests are crucial in:
-
Market Analysis
- Testing mean reversion in price series
- Validating statistical arbitrage strategies
- Analyzing spread relationships
-
Risk Management
- Assessing stability of volatility processes
- Validating assumptions in Value at Risk (VaR) models
- Evaluating correlation stability
Making non-stationary data stationary
Common transformations include:
-
Differencing
- First differences for trend removal
- Seasonal differencing for periodic patterns
-
Detrending
- Linear trend removal
- Exponential moving average smoothing
-
Variance Stabilization
- Log transformation
- Box-Cox transformation
Practical considerations
When applying stationarity tests:
-
Sample Size
- Larger samples provide more reliable results
- Short series may require alternative approaches
-
Test Selection
- Different tests have varying power against different alternatives
- Consider using multiple tests for robustness
-
Economic Context
- Not all financial series should be stationary
- Some non-stationarity may be economically meaningful
Implementation in time-series databases
Modern time-series databases often include built-in functionality for:
-
Automated Testing
- Batch processing of multiple series
- Real-time stationarity monitoring
-
Data Transformation
- On-the-fly differencing
- Automated detrending
-
Result Storage
- Efficient storage of test statistics
- Historical test results tracking
The understanding and application of stationarity tests remains fundamental to time-series analysis, particularly in financial markets where stable statistical properties are crucial for modeling and prediction.