Fit model with 3 independent variables and many parameters to data?

조회 수: 2 (최근 30일)
Is it possible to use the fit() function to fit a model with 3 independent variables and many parameters (coefficients)? Reading through the documentation, I get the impression that Matlab only supports 2 independent variables. Any insight would be helpful.
Thanks, Justin
  댓글 수: 1
Matt J
Matt J 2012년 10월 26일
For more general kinds of fitting, you probably need Optimization Toolbox solvers.

댓글을 달려면 로그인하십시오.

채택된 답변

Sean de Wolski
Sean de Wolski 2012년 10월 26일
Do you have the Statistics or Optimization Toolboxes? If so:
Optim:
* doc lsqcurvefit
* doc lsqlin
* doc lsqnonlin
Stats:
* doc NonlinearModel
* doc LinearModel
* doc regress
I'm missing many others, we can point you in a more specific direction if you have more details.
  댓글 수: 4
Justin Solomon
Justin Solomon 2012년 10월 26일
편집: Justin Solomon 2012년 10월 26일
Sorry, my code is a little bit messy right now (its written in a GUI and it would take me a while to put it in an understandable format).
I've implemented the lscurvefit() routine. It works in a reasonable amount of time if I give it a good starting guess and limits.
Anyways, is there a way to weight input data points (ydata)? In other words, some of my data points are less important than others so I would like to minimize a 'weighted' sum of square errors instead of the normal sum of square errors used by default. Possible? Thanks again for your help.
Justin Solomon
Justin Solomon 2012년 10월 26일
I just saw that I can use lsqnonlin() instead of lsqcurvefit() to do what I need because in lsqnonlin() the function that your minimizing is supposed to return the residuals instead of the predicted values as in lsqcurvefit(). Thus I can just weight the residuals that are returned in my function definition.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Sander van Otterdijk
Sander van Otterdijk 2019년 4월 18일
hoi
dit is een code
do
if code = dit
do: zijn.
end

카테고리

Help CenterFile Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by