Skip to content

Program the computes the values for the linear equation: y = mx + b using custom-defined matrix operations.

Notifications You must be signed in to change notification settings

MalikCoderGreen/Linear-Regression-of-Oridnary-Least-Squares

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linear Regression Line

The goal of this program is to compute the values of the linear equation y = mx + b while using matrix operations. This program will read in a text file of points stored in the form of a 2 x N matrix and calculate the regression line for those points using built in matrix operations.

Must run this program using a points file; there is one in this repository I have provided as an example.

Make file is included for all dependencies.

Motivation

This was my first project for my data-structures and algorithms class in undergrad.

Language

C++ 11

Sample run

./ols points100.txt

Based on the file points100.txt here is the solution for the equation y = mx + b.

Optimal vector Beta: |1.97942| |4.78617|

Number of operations to obtain answer: 24

About

Program the computes the values for the linear equation: y = mx + b using custom-defined matrix operations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published