Task 3
Task 3
inverse method.
Aim
To perform least squares regression by solving the normal equations using the direct inverse
method. The goal is to find the optimal coefficients (slope and intercept) that minimize the
squared residuals between observed and predicted values.
Python Code
import numpy as np
import matplotlib.pyplot as plt
Output
Result
This approach demonstrates solving a linear regression problem using the direct inverse
method, which is mathematically efficient but may become computationally expensive for
large datasets due to matrix inversion.