Metadata-Version: 2.1
Name: epgm_model
Version: 0.1.1
Summary: Implementation of the EPGM model for time series forecasting.
Author: Haris Masood
Author-email: haris_masood@yahoo.com
License: MIT
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Office/Business :: Financial
Description-Content-Type: text/markdown
Requires-Dist: numpy
Requires-Dist: scikit-learn
Requires-Dist: pandas
Requires-Dist: matplotlib
Requires-Dist: scipy

# EPGM (2,1, Tau)

[![PyPI version](https://img.shields.io/pypi/v/epgm_model.svg)](https://pypi.org/project/epgm_model/)

An open-source Python implementation of the EPGM(2,1,Tau) model from the paper:  
*A novel dynamic time-delay grey model of energy prices and its application in crude oil price forecasting*  
https://doi.org/10.1016/j.energy.2022.123968

---

## Overview

EPGM is a second-order grey forecasting model designed to improve traditional grey models by incorporating a time delay parameter **Tau**.

This implementation allows fitting and forecasting with the EPGM(2,1,Tau) model, supporting parameter optimization using simulated annealing, regularized regression, and multi-step ahead prediction.

---

## Features

- Fit EPGM(2,1,Tau) model on univariate time series data  
- Optimize model parameters (`r1`, `tau`, regularization alpha) via simulated annealing  
- Support both unregularized least squares and Ridge regression solvers  
- Predict future values with option to constrain predictions to positive values  
- Handles data normalization internally  
- Built-in evaluation using Mean Absolute Percentage Error (MAPE)  
- Plotting utilities for visualizing test set performance  

---

## Installation

```bash
pip install epgm_model
