A research-oriented implementation of the Normal Equations method for solving the Multiple Linear Regression problem in closed form.
This repository provides a mathematically explicit implementation of the Normal Equations approach for solving the least squares problem:
The closed-form solution is given by:
where:
-
$X \in \mathbb{R}^{n \times p}$ is the design matrix -
$y \in \mathbb{R}^n$ is the target vector -
$\beta \in \mathbb{R}^p$ is the parameter vector
The objective function is:
Taking the gradient with respect to
Setting the gradient to zero:
Assuming
The Normal Equations require:
so that:
Otherwise, the matrix is singular and the solution is not uniquely defined.
- Explicit matrix-based implementation
- Minimal NumPy dependencies
- Research-friendly structure
- Suitable for educational use
- Fully reproducible closed-form solver
git clone https://github.com/USERNAME/Normal-equations-solver-multiple-linear-regression.git
cd Normal-equations-solver-simple-linear-regression
pip install -r requirements.txt