Linear Model with 4 parameters

4 次查看(过去 30 天)
Robert Demyanovich
Robert Demyanovich 2022-2-28
评论: Torsten 2022-2-28
I need to come up with an estimate for the starting values of the coefficients of a rational model. The rational model is:
One source says that I could do this by performing a linear fit on the model:
I'm using Matlab to fit the rational model, but it performs poorly if I don't use good starting points for the coefficients.
How can I use Matlab to perform this linear regression on 4 data points in order to get starting values for A0, A1, B1 and B2?
  2 个评论
Alex Sha
Alex Sha 2022-2-28
Show the data and the code your have written
Torsten
Torsten 2022-2-28
If you only have 4 data points, then the best fit parameters to the linear model will in most cases already be the best-fit parameters to the rational model. This is because you usually get a unique solution for 4 equations in 4 unknowns.

请先登录,再进行评论。

回答(1 个)

Matt J
Matt J 2022-2-28
编辑:Matt J 2022-2-28
Asssuming x and y are column vectors,
Q= [x.^0, x, -x.*y, -x.^2.*y,-y];
[~,~,V]=svd(Q,0);
coeffs=num2cell( V(:1:4)/V(end) );
[A0,A1,B1,B2]=deal(coeffs{:});

类别

Help CenterFile Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by