how to solve rank deficiency warning problem?

조회 수: 9 (최근 30일)
neha
neha 2013년 1월 28일
답변: Kerry Hipps 2019년 12월 15일
I have written a code but it is showing some warnings due to which i m getting improper outputs.....the code is as follows:
any help would be appreciated....
clear
clc
clf
format compact
% the data
y=[9.64E-11 5.29E-11 5.34E-11 5.32E-11 5.34E-11 5.34E-11 5.36E-11 5.35E-11 5.29E-11 5.29E-11 5.29E-11 5.30E-11 5.28E-11 5.28E-11 5.29E-11 5.28E-11 5.28E-11 5.27E-11 5.27E-11 5.28E-11 5.27E-11 5.26E-11 5.27E-11 5.26E-11 5.27E-11 5.26E-11 5.26E-11 5.26E-11 5.26E-11];
f=[1.00E+02 3.54E+03 6.99E+03 1.04E+04 1.39E+04 1.73E+04 2.08E+04 2.42E+04 2.77E+04 3.11E+04 3.45E+04 3.80E+04 4.14E+04 4.49E+04 4.83E+04 5.18E+04 5.52E+04 5.87E+04 6.21E+04 6.56E+04 6.90E+04 7.24E+04 7.59E+04 7.93E+04 8.28E+04 8.62E+04 8.97E+04 9.31E+04 9.66E+04];
w=(2*pi)*f;
% the proposed functionality (fh is a handle to the function)
fh=@(b,w) 1./(((b(1)+(b(2)./(1+(b(2).*w.*b(3)).^2))).^2)./((b(2).^2.*b(3))./(1+(b(2).*w.*b(3)).^2))+((b(2).^2.*w.*b(3))./(1+(b(2).*w.*b(3)).^2)));
% guess values for parameters (beta0)
b0=[1,1,1];
% plot the raw data
plot(w,y,'s','markersize',5,'color',[0,0,0]);
hold on
% determine best fit values for coefficient (bhat)
bhat=nlinfit(w,y,fh,b0);
% plot the fit
xf = linspace(w(1), w(length(w)));
plot(xf,fh(bhat,xf),'linewidth',1,'color',[1,0,0]);
legend('original data','fitdata','location','Best') % the result
bhat(1)
bhat(2)
bhat(3)
the warnings are as follows:
Warning: Rank deficient, rank = 2, tol = 1.7048e-020.
> In nlinfit>LMfit at 295
In nlinfit at 167
In neha_test1 at 17
Warning: Rank deficient, rank = 2, tol = 5.8195e-021.
> In nlinfit>LMfit at 295
In nlinfit at 167
In neha_test1 at 17
Warning: Rank deficient, rank = 2, tol = 1.9867e-021.
> In nlinfit>LMfit at 295
In nlinfit at 167
In neha_test1 at 17
Warning: Rank deficient, rank = 2, tol = 6.7835e-022.
> In nlinfit>LMfit at 295
In nlinfit at 167
In neha_test1 at 17
Warning: Rank deficient, rank = 2, tol = 2.3173e-022.
> In nlinfit>LMfit at 295
In nlinfit at 167
In neha_test1 at 17
Warning: Rank deficient, rank = 2, tol = 7.9252e-023.
> In nlinfit>LMfit at 295
In nlinfit at 167
In neha_test1 at 17
Warning: Rank deficient, rank = 2, tol = 2.7174e-023.
> In nlinfit>LMfit at 295
In nlinfit at 167
In neha_test1 at 17
Warning: Rank deficient, rank = 2, tol = 9.3744e-024.
> In nlinfit>LMfit at 295
In nlinfit at 167
In neha_test1 at 17
Warning: Rank deficient, rank = 2, tol = 3.2799e-024.
> In nlinfit>LMfit at 295
In nlinfit at 167
In neha_test1 at 17
Warning: Rank deficient, rank = 2, tol = 1.1852e-024.
> In nlinfit>LMfit at 295
In nlinfit at 167
In neha_test1 at 17
Warning: Rank deficient, rank = 2, tol = 4.6048e-025.
> In nlinfit>LMfit at 295
In nlinfit at 167
In neha_test1 at 17
Warning: Rank deficient, rank = 2, tol = 2.0921e-025.
> In nlinfit>LMfit at 295
In nlinfit at 167
In neha_test1 at 17
Warning: Rank deficient, rank = 2, tol = 1.1485e-025.
> In nlinfit>LMfit at 295
In nlinfit at 167
In neha_test1 at 17
Warning: Rank deficient, rank = 2, tol = 1.1485e-025.
> In nlinfit>LMfit at 322
In nlinfit at 167
In neha_test1 at 17
Warning: Rank deficient, rank = 2, tol = 1.1485e-025.
> In nlinfit>LMfit at 322
In nlinfit at 167
In neha_test1 at 17
Warning: Rank deficient, rank = 2, tol = 7.8466e-026.
> In nlinfit>LMfit at 295
In nlinfit at 167
In neha_test1 at 17
Warning: Rank deficient, rank = 2, tol = 7.5760e-026.
> In nlinfit>LMfit at 295
In nlinfit at 167
In neha_test1 at 17
Warning: Rank deficient, rank = 2, tol = 7.5760e-026.
> In nlinfit>LMfit at 322
In nlinfit at 167
In neha_test1 at 17
Warning: Rank deficient, rank = 2, tol = 7.5760e-026.
> In nlinfit>LMfit at 322
In nlinfit at 167
In neha_test1 at 17
Warning: Rank deficient, rank = 2, tol = 7.4567e-026.
> In nlinfit>LMfit at 295
In nlinfit at 167
In neha_test1 at 17
Warning: Rank deficient, rank = 2, tol = 7.4567e-026.
> In nlinfit>LMfit at 322
In nlinfit at 167
In neha_test1 at 17
Warning: The Jacobian at the solution is ill-conditioned, and some
model parameters may not be estimated well (they are not identifiable).
Use caution in making predictions.
> In nlinfit at 224
In neha_test1 at 17
could anybody fix this problem...?
  댓글 수: 3
shantanu
shantanu 2014년 1월 27일
hiii what does colour signify here thanks in advance.
Kerry Hipps
Kerry Hipps 2019년 6월 19일
I too have questions about rank deficiency, in my case it is
Warning: Rank deficient, rank = 3, tol = 4.989138e-12.
> In nlinfit>LMfit (line 587)
In nlinfit>nlrobustfit (line 768)
In nlinfit (line 315)
In SPR_ODE45_P4x (line 58)
The last is my calling program

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

답변 (2개)

Artur Hahn
Artur Hahn 2019년 12월 14일
I too have a problem with the rank deficiency. I get "Warning: Rank deficient, rank = 1, tol = 1.666613e+04."
when trying to solve a system of linear equations c = A\y. Any help or explanation of the meaning/problem would be appreciated.

Kerry Hipps
Kerry Hipps 2019년 12월 15일
No solution yet. I switched to lsqcurvefit. Would still like to find a solution.

카테고리

Help CenterFile Exchange에서 Dynamic System Models에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by