From: Rabi on
Hi
I have a matrix of size 800 x 5 containing the data of the five independent variables a,b,c,d,e and vector 800 x 1 containing the data for the dependent variable z.

I want to fit a model for the data giving the functional relation between dependent variable z and five independent variables a,b,c,d,e.

My questions are:
1. Which functions/tools in MATLAB should I used to get the best fit?
2. Which MATLAB tools/functions should I used to get an expression of the fitted model and also validate the fitted model?

Best Regards,
Rabi
From: us on
"Rabi " <rabikhattak(a)gmail.com> wrote in message <i2jtcs$lp5$1(a)fred.mathworks.com>...
> Hi
> I have a matrix of size 800 x 5 containing the data of the five independent variables a,b,c,d,e and vector 800 x 1 containing the data for the dependent variable z.
>
> I want to fit a model for the data giving the functional relation between dependent variable z and five independent variables a,b,c,d,e.
>
> My questions are:
> 1. Which functions/tools in MATLAB should I used to get the best fit?
> 2. Which MATLAB tools/functions should I used to get an expression of the fitted model and also validate the fitted model?
>
> Best Regards,
> Rabi

one of the many possible hints:

doc mldivide;

us
From: Richard Willey on
> "Rabi " <rabikhattak(a)gmail.com> wrote in message
> <i2jtcs$lp5$1(a)fred.mathworks.com>...
>> Hi
>> I have a matrix of size 800 x 5 containing the data of the five
>> independent variables a,b,c,d,e and vector 800 x 1 containing the data
>> for the dependent variable z. I want to fit a model for the data giving
>> the functional relation between dependent variable z and five
>> independent variables a,b,c,d,e.
>>
>> My questions are:
>> 1. Which functions/tools in MATLAB should I used to get the best fit?
>> 2. Which MATLAB tools/functions should I used to get an expression of the
>> fitted model and also validate the fitted model?
>>
>> Best Regards,
>> Rabi

Based on the description of your problem, you probably want to be using
functions included in Statistics Toolbox.

"mvregress" is your best starting point if you are performing a linear
regression.
You can using "nlinfit" for a parametric nonlinear regression

In addition to these functions, you probably want to look at:

crossval and cvparation (both used for cross validation)
stepwise (for stepwise regression)

The following demo on Partial Least Squares Regression and Principal
Components Regression provides a nice discussion of many related topics.

http://www.mathworks.com/products/statistics/demos.html?file=/products/demos/shipping/stats/plspcrdemo.html

If you are trying to generate a nonparametric model, your best option is to
look at the regression option inside "treebagger". Treebagger has built in
support for cross validation and estimating the importance of different
features.

The online documentation includes a very nice discussion about "Regression
and Classification by Bagging Decision Trees" which should help you get
started with nonparametric modeling.

http://www.mathworks.com/access/helpdesk/help/toolbox/stats/br0gosr-1.html