Finding Weighted Coefficients of Variables

3 views (last 30 days)
Kevin Hout
Kevin Hout on 11 Jul 2017
Commented: Star Strider on 11 Jul 2017
I have a data set of 15 experiments, which are separated into 11 columns (15x11 matrix). There are 10 variables (10 columns) that I would like to analyze to see how they play a role in the 11th column (the result). What method or option would be the best route for this analysis?
Thanks!

Answers (1)

Star Strider
Star Strider on 11 Jul 2017
It depends what your experiment is and if you have a mathematical model of the process that produced your data. If you do and the process is nonlinear, then use a nonlinear function fit with a nonlinear regression function (such as nlinfit and lsqcurvefit) to get the parameter estimates and then confidence intervals for them (with nlparci). You can also use fitnlm for nonlinear models, and fitlm for linear models.
If your process can be modeled by a linear regression, this could work:
A = Your_Matrix; % Create Data
[b,bint] = regress(A(:,11), A(:,1:10)); % Return Parameter Estimates & Confidence Intervals
Coefficients (here the ‘b’ vector, but it applies to all regressions) with confidence intervals that include zero (have opposite signs) are not needed in the model.
  5 Comments
Image Analyst
Image Analyst on 11 Jul 2017
I think PCA could work. Here's what the help says:
Partial Least Squares Regression and Principal Components Regression
This example shows how to apply Partial Least Squares Regression (PLSR) and Principal Components Regression (PCR), and discusses the effectiveness of the two methods. PLSR and PCR are both methods to model a response variable when there are a large number of predictor variables, and those predictors are highly correlated or even collinear. Both methods construct new predictor variables, known as components, as linear combinations of the original predictor variables, but they construct those components in different ways. PCR creates components to explain the observed variability in the predictor variables, without considering the response variable at all. On the other hand, PLSR does take the response variable into account, and therefore often leads to models that are able to fit the response variable with fewer components. Whether or not that ultimately translates into a more parsimonious model, in terms of its practical use, depends on the context.
There is a demo included in the help.

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!