Skip to content

Instantly share code, notes, and snippets.

@JohanAR
JohanAR / PolynomialRegression.h
Last active January 20, 2020 14:46 — forked from chrisengelsma/PolynomialRegression.h
Polynomial regression in c++
#ifndef _POLYNOMIAL_REGRESSION_H
#define _POLYNOMIAL_REGRESSION_H __POLYNOMIAL_REGRESSION_H
/**
* PURPOSE:
*
* Polynomial Regression aims to fit a non-linear relationship to a set of
* points. It approximates this by solving a series of linear equations using
* a least-squares approach.
*
* We can model the expected value y as an nth degree polynomial, yielding