PHPackages                             mykolavuy/forecast - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mykolavuy/forecast

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mykolavuy/forecast
==================

PHP library for linear, power, and logarithmic regression forecasting.

v0.3.0(11mo ago)10MITPHPPHP ^8.1

Since May 16Pushed 11mo agoCompare

[ Source](https://github.com/MykolaVuy/ForecastRegressions)[ Packagist](https://packagist.org/packages/mykolavuy/forecast)[ RSS](/packages/mykolavuy-forecast/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

📈 Forecast Regressions
======================

[](#-forecast-regressions)

[![PHP Version](https://camo.githubusercontent.com/7535257ca228724c93658bd52583d4e47a9bab02c356abf6e54c1d575f2151e6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d626c75652e737667)](https://www.php.net/)[![MIT License](https://camo.githubusercontent.com/f0fa81d634309450d2baf8b61df694a8faba976abf947142e1483858bc96c699/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d6461726b677265656e2e737667)](LICENSE)[![GitHub Repo](https://camo.githubusercontent.com/8cd430fa813c01c2361f4e4ac70fc958da706e1d451cbb315bdb8f5c9b65a4fc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d4769744875622d626c61636b3f6c6f676f3d676974687562)](https://github.com/MykolaVuy/ForecastRegressions)

A simple and extensible library for forecasting missing data points using different regression models: **Linear**, **Power**, **Logarithmic**, and **Exponential**. Designed for PHP 8.1+.

---

✨ Features
----------

[](#-features)

- 📊 Supports **Linear**, **Power**, **Logarithmic**, and **Exponential** regression.
- 🔍 Optional **interpolation-only** mode to avoid extrapolation.
- 🧩 Pluggable architecture via `RegressionInterface`.
- ⚡️ Fast, simple, and **stateless static prediction**:
    `ForecastService::predict($data, $method)`
- ✅ Thoroughly unit-tested.

---

📂 Source Code
-------------

[](#-source-code)

The complete source code is available on [GitHub](https://github.com/MykolaVuy/ForecastRegressions).

---

🛠 Installation
--------------

[](#-installation)

```
    composer require mykolavuy/forecast-regressions
```

---

🚀 Usage
-------

[](#-usage)

```
use MykolaVuy\Forecast\ForecastService;

$data = [
    1 => 10,
    2 => null,
    3 => 30,
    4 => null,
    5 => 50,
    6 => null,
];

$service = new ForecastService();

// Linear regression forecast
$result = $service->forecast($data, method: 'linear');

// Power regression with interpolation only
$interpolated = $service->forecast($data, method: 'power', interpolateOnly: true);

// 🔹 Static call (no instance needed)
$static = ForecastService::predict($data, method: 'exponential');
```

---

🔧 Regression Methods
--------------------

[](#-regression-methods)

MethodFormulaDescription`linear`y = a \* x + bStraight-line fitting`power`y = a \* x^bExponential-style growth/decay`logarithmic`y = a + b \* log(x)Logarithmic trend modeling`exponential`y = a \* e^(b \* x)Classic exponential regression---

✅ Requirements
--------------

[](#-requirements)

- PHP 8.1 or higher
- Composer

---

🧪 Running Tests
---------------

[](#-running-tests)

```
    ./vendor/bin/phpunit
```

> Test files are located in the tests/ directory.

---

📄 License
---------

[](#-license)

This project is licensed under the [MIT License](LICENSE).

---

🌐 Projects by the Author
------------------------

[](#-projects-by-the-author)

### [intester.com](https://intester.com)

[](#intestercom)

> **InTester** is a secure and transparent online knowledge assessment platform. It offers time-limited tests, anti-cheating measures, instant results with PDF certificates, and public test records — making it ideal for job seekers and recruiters alike.

### [dctsign.com](https://dctsign.com)

[](#dctsigncom)

> **DCT Sign** is a blockchain-backed electronic signature platform that prioritizes privacy and data integrity. Users can securely sign documents without storing the original files, ensuring confidentiality and compliance with advanced e-signature standards.

---

*Thank you for using ForecastRegressions! Contributions and feedback are welcome.*

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance54

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~19 days

Total

2

Last Release

338d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/85d98199500b9c63de707a2a1f3a97055ccc1a4d77b6285300962a819242b0ae?d=identicon)[MykolaVuy](/maintainers/MykolaVuy)

---

Top Contributors

[![MykolaVuy](https://avatars.githubusercontent.com/u/28922289?v=4)](https://github.com/MykolaVuy "MykolaVuy (8 commits)")

---

Tags

exponential-regressionforecastlinear-regressionlogarithmic-regressionmathpower-regressionregresssion

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mykolavuy-forecast/health.svg)

```
[![Health](https://phpackages.com/badges/mykolavuy-forecast/health.svg)](https://phpackages.com/packages/mykolavuy-forecast)
```

###  Alternatives

[razonyang/yii2-rate-limiter

Yii2 Rate Limiter

1025.0k1](/packages/razonyang-yii2-rate-limiter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
