GretlVARVECMTime Series Forecasting

Energy Sector Stock Price Forecasting Around COVID-19

A time-series forecasting analysis of energy sector stock prices using three complementary modeling approaches to capture market dynamics before and after the COVID-19 shock.

Overview

This project forecasts weekly stock prices for energy sector companies, examining how different time-series modeling approaches perform in capturing market behavior before and after the COVID-19 pandemic. The analysis uses three complementary forecasting frameworks — Univariate models, Vector Autoregression (VAR), and Vector Error Correction Model (VECM) — implemented in Gretl with supporting visualizations generated in Excel.

Motivation

The COVID-19 pandemic created an unprecedented shock to global energy markets, disrupting supply chains, collapsing demand, and creating extreme price volatility. Understanding how different forecasting models handle such structural breaks is valuable both for academic research and practical investment decision-making.

Methodology

  • Univariate Model: A baseline autoregressive approach using each stock's own historical price series. Captures simple persistence and trend patterns.
  • Vector Autoregression (VAR): Models the joint dynamics of multiple energy stocks simultaneously, allowing each stock to respond to its own history as well as the histories of other stocks in the system.
  • Vector Error Correction Model (VECM): An extension of VAR for non-stationary series that are cointegrated. Decomposes movements into short-term adjustments and long-term equilibrium corrections, making it particularly suited for modeling how energy stocks revert to fundamental relationships after shocks.

Data & Preprocessing

Weekly stock price data for multiple energy companies was collected and preprocessed. Key steps included computing log differences to achieve stationarity, generating correlograms (ACF/PACF) to identify appropriate lag structures, and testing for cointegration relationships among the series before fitting VECM models.

Key Findings

Multivariate models (VAR and VECM) generally provide more accurate forecasts than univariate baselines, particularly during periods of high volatility when cross-stock relationships become more pronounced. The VECM model proved especially useful for capturing the long-run equilibrium dynamics among energy stocks as markets adjusted to post-pandemic conditions.

Visualizations & Results

Time series comparison of actual vs. forecasted energy stock prices using VAR and VECM models around the COVID-19 period.
Time series comparison of actual vs. forecasted energy stock prices using VAR and VECM models around the COVID-19 period.
Correlogram (ACF/PACF) analysis identifying optimal lag structures for the autoregressive forecasting models.
Correlogram (ACF/PACF) analysis identifying optimal lag structures for the autoregressive forecasting models.
Residual diagnostics and model fit evaluation comparing univariate, VAR, and VECM forecasting performance.
Residual diagnostics and model fit evaluation comparing univariate, VAR, and VECM forecasting performance.
Energy sector stock price trajectories before and after the COVID-19 shock, showing volatility patterns across companies.
Energy sector stock price trajectories before and after the COVID-19 shock, showing volatility patterns across companies.

Technologies & Tools

GretlVAR ModelVECMUnivariate ForecastingTime Series AnalysisExcel