Multivariate nonlinear (polynominal) regression

Hi,
I would like to know if MATLAB does any multivariate (NOT multivariable) nonlinear regression. The 'mvregress' command only carries out a linear multivariate regression (with no squared or interaction terms). To put it simply, say if I had 2 response variables, y1 and y2, and 3 input variables, x1, x2, x3. I would like to have the regression in a way where y1 and y2 are described by x1, x2 and x3 using linear as well as squared and interaction terms. Is this possible in MATLAB?
Thanks

2 Comments

Just to clarify one important point. The word "linear" in a linear regression refers to linearity in the coefficients, not the variables. You can makes a linear regression in which x1.^2 or x1.*x2 are explanatory variables.
Yes. This is a LINEAR regression. The regress tools all handle interaction terms, you just need to build them as such.
For example, if you had a model of the form
z(x,y) = a + b*x + c*y + d*x*y + e*x^2 + f*y^2
this is not a nonlinear regression. You simply supply predictors of the form x, y, x*y, x^2, y^2. Some tools require you to supply a column of ones to dictate a constant term, others presume the constant term is there, and add it for you.

Sign in to comment.

Answers (2)

Polyfitn. It is on the file exchange.

2 Comments

Will polyfitn() handle more than one response (i.e. "Y") variable? I had originally suggested nlinfit(), but realized that it does not.
If you have multiple response variables, then this is simply multiple regressions since it will require separate sets of regression coefficients. Just use a loop.

Sign in to comment.

You might find my and others' answers in this question to be useful to your understanding of mvregress.

Asked:

on 30 Sep 2014

Commented:

on 1 Oct 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!