ML101: Polynomial Regression

Polynomial regression is a form of linear regression in which the relationship between the independent variable x and the dependent variable y is modelled as an nth degree polynomial.

Here is the simplest Polynomial:  One independent variable – Second order (also known as quadratic function)

image

image

The next larger Polynomial: One independent variable – Third order (also known as cubic function)

image

image

One independent variable – Fourth order (also known as quartic function):

image

image

 

So how do we actually fit a model like this to our data?

Using the machinery of multivariant linear regression, we can do this with a simple modification to our algorithm:

image

in which x1 = x, x2 = x2, x3 = x3

In this way, the polynomial regression problem becomes a multivariant linear regression problem, and can use the gradient decent or normal equation algorithm to solve it.

One thought on “ML101: Polynomial Regression

Leave a Reply