Coder Social home page Coder Social logo

talisma-cassoma / the-method-of-least-squares-on-matlab Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 277 KB

it's a standard approach in regression analysis to approximate the solution of overdetermined systems (sets of equations in which there are more equations than unknowns)

MATLAB 100.00%
predictions matlab least-square-regression machine-learning-algorithms polynomial-regression non-linear-regression

the-method-of-least-squares-on-matlab's Introduction

POLYNOMIAL REGRESSION by method of least squares on Matlab

see the code in C language here

linear regression image

# What for?

If you have a set of data

Did you know that in math it is possible to find a function which produces its same set of data regardless of how they are arranged?

So yes! using The method of least squares we can do it, we can predict (with a margin of error, of course)what are the next sequence values or any other values of a data set

This code is the application of that math method used in machine learning for solving linear regression problem

Projet issues

General Introduction

Being able to draw conclusions about data trends is one of the most important steps in business and science. Often, the questions we ask ourselves force us to make predictions.This projet describes a relationship between time spent reviewing and grade, we try to mathematically generate a function that describes the behavior of notes as a function of time. Of course, this example is not as realistic as it is claimed because in reality there are other factors envolved, such as the quality of the student etc, etc , but we will ignore factors of confusion like this for now and work a simple example. Everyone already knows that there is a positive relationship between time spent reviewing and grade. that we get, but we're going to need some data to demonstrate it correctly.



The method of least squares makes it possible to select among these functions the one which reproduces the better experimental data. We speak in this case of adjustment by the least method squares.The method consists of a prescription (empirical method), which is that the function fα (x) which best describes the data is that which minimizes the quadratic sum of the deviations of the measures to the predictions of y (x). I presume that you also snow how The method of least squares works, if not search on wikipedia for this details cause this part is just the application of it


let a set of measures ῼ = { (x1, y1) , (x2, y2) .......(xn, yn) }

we search :

fα (x )= α0 + α1x + α2x² + …… αNxN

with :

α ={ α0 , α1 , α2 , α3 , α4 , α5 , α6 …… αN }

Remark the first graph has N=6 and the last one has N=9

Note Analysis:

We can clearly see that our function fα (x) for N = 6 does not approach very well y (x) for the polynomials of N = 7 and 8. The best approximation is that of the polynomial of degree N = 9, by tests I found that degrees greater than 9 were also shown to be bad approximations.

this algorithm is also valid for linear regression seen that it too is a polynomial regression of degree 1.

the-method-of-least-squares-on-matlab's People

Contributors

talisma-cassoma avatar ttury avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.