File Exchange

image thumbnail

Multivariate Polynomial Regression

version 1.4 (107 KB) by

Performs polynomial regression on multidimensional data.

18 Ratings



Performs Multivariate Polynomial Regression on multidimensional data. The fits are limited to standard polynomial bases with minor modification options. Feel free to implement a term reduction heuristic.
The functionality is explained in hopefully sufficient detail within the m.file. Feel free to post a comment or inquiry.
No longer requires ANY additional toolboxes!
Head over to or the GitHub page on the right for a full illustrated tutorial. You can also publish Example.m for the same purpose.
Author: Ahmet Cecen, MINED @ Gatech

Comments and Ratings (33)

Ahmet Cecen

Ahmet Cecen (view profile)

Yep makes sense. I encourage you to submit this change as a pull request in GitHub. Otherwise I will fix it when I get a chance.

Changing line 186-187 from:

Speeds things up (and saves memory)

Great tool!

Nanbo Li


Yodish (view profile)

this is a brilliant function

Oleg Boiko


vina (view profile)

I really want this regression method to try my data. But this terrible web page always fails. Can someone send it to me please? My email is


vina (view profile)

Ahmet Cecen

Ahmet Cecen (view profile)

I don't think I have explained this code exhaustively in publications. You can e-mail me for explanations of any particular section, my contact info is easy to find online. Otherwise search for the following concepts:
- Polynomial Basis
- Multivariate Regression
- Leave One Out Cross Validation
- Sherman-Morrison Formula
- QR factorization (and regression)

@Ahmet Cecen Can you give me the papers where the methodologie is explained?


Ahmet Cecen

Ahmet Cecen (view profile)

An oversight. Will fix it when I get a chance.

To suppress output that may not be required, please add a semicolon to the expression in line 173.
eval(['PolyExp = ',variablesexp,Poly,';']);

Habib Yajam

Fast and easy to use. MATLAB lacks such a function in its original releases.

Habib Yajam

Fast and easy to use. MATLAB lacks such a function in its stock releases.

Easy to use.

Ahmet Cecen

Ahmet Cecen (view profile)

If you send me an e-mail I can reply back to it with the zip file. My contact info is everywhere just Google my name, or go to my account.

Ahmet Cecen

Ahmet Cecen (view profile)

I was able to download it just this second. I'll send it anyways if you have contact information on your account.

The file is no longer available.
Can someone send it to me please ?


easumj (view profile)

Excellent code, I have been looking for multivariate polynomial regression tools for quite some time.

Silpakorn D

Xinyi Gong

Ahmet Cecen

Ahmet Cecen (view profile)

If you send me (it's very easy to find my contact information online, including my profile here) the data and parameters to replicate your situation, I can look into it. Otherwise very hard for me to search for a random bug.


Rita (view profile)

Hi Thanks for the function.I have tried your function with my seven independent and one dependent variable and R-squared is 0.19 which is not high.How can I get higher R-squared ?I also got error when I used 'range'.Any suggestion would be appreciated in advance.

Karel Macek


Sagar (view profile)

Hi, I tried to use the function but I have a lot of NaNs in my data. It looks like it cannot handle data with NaNs. Could you please update to include NaNs?

Ahmet Cecen

Ahmet Cecen (view profile)



Morgan (view profile)

Ahmet Cecen

Ahmet Cecen (view profile)

Added examples upon request.



Removed toolbox dependencies completely.


Repository renamed.


Can now handle rank deficient data matrices.


Substantially more detailed explanations. Almost completely revamped output. Stronger goodness of fit measures.

MATLAB Release
MATLAB 8.4 (R2014b)

MATLAB Online Live Editor Challenge

Win cash prizes and have your live script featured on our website

Learn more

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video