For a fully analysis, please read here
This project explores the concepts of non-stationarity and equilibrium in time series data, focusing on methods to test and model such data. Using Apple stock price data from 2013 to 2023 as an example, the report demonstrates key tests and visualization techniques to identify non-stationarity and suggests modeling approaches.
Non-stationary time series data exhibit changing statistical properties (e.g., mean, variance) over time. Identifying and addressing non-stationarity is critical for accurate modeling and forecasting.
Equilibrium refers to the long-term stable relationship in time series data. Techniques like co-integration help identify equilibrium, enabling better decision-making and model selection.
The ADF test checks for the presence of a unit root in a time series. A high p-value indicates non-stationarity. The ADF equation is defined as:
Where:
-
$$( \Delta Y_t )$$ : Change in the series at time$$( t )$$ . -
$$( \alpha )$$ : Constant term. -
$$( \beta t )$$ : Coefficient for a time trend. -
$$( \gamma )$$ : Coefficient for the lagged level of the series. -
$$( \delta_i )$$ : Coefficients for the lagged changes of the series. -
$$( \varepsilon_t )$$ : Error term at time$$( t )$$ . -
$$( p )$$ : Number of lagged changes included. -
Result:
- ADF Statistic:
0.4887
- p-value:
0.9845
- Conclusion: Fail to reject the null hypothesis; the series is non-stationary.
- ADF Statistic:
The KPSS test checks for stationarity around a deterministic trend. The KPSS equation is given by:
Where:
-
$$( Y_t )$$ : Time series at time$$( t )$$ . -
$$( \rho )$$ : Coefficient indicating the autoregressive nature. -
$$( \mu )$$ : Constant term. -
$$( \tau )$$ : Coefficient for a deterministic trend. -
$$( u_i )$$ : Stationary random error terms. -
Result:
- KPSS Statistic:
7.406
- p-value:
0.01
- Conclusion: Reject the null hypothesis; the series is non-stationary.
- KPSS Statistic:
The plot indicates an upward trend in Apple stock prices, confirming non-stationarity.
The rolling mean shows an increasing trend, reinforcing non-stationarity.
- Trend: Clear upward trajectory.
- Seasonality: No significant pattern detected.
- Residual: High volatility remains.
- ACF: Gradual decline indicates strong autocorrelation and non-stationarity.
- PACF: Significant spike at lag 1 suggests an AR(1) process.
-
Model Selection: Use an ARIMA model. Based on ACF and PACF:
- Suggested Model: ARIMA(1,1,0)
- AR(1): One autoregressive term.
- I(1): First-order differencing.
- MA(0): No moving average terms.
- Suggested Model: ARIMA(1,1,0)
-
Model Validation:
- Ensure residuals are white noise to confirm a good fit.
- Fit the ARIMA model to the data.
- Perform residual diagnostics to validate the model.
- Address any outliers or leverage points.
- Enders, W. (2014). "Applied Econometric Time Series." Wiley.