doseResponse function rank deficient warning

조회 수: 1 (최근 30일)
Aaron Ouyang
Aaron Ouyang 2022년 7월 14일
답변: Riya 2024년 1월 22일
Hi,
I've been running the doseResponse function downloaded from here. However, I've been having trouble generating a sigmoidal curve that fits my data. By running the following code, I get the following error and produce the following graph. Does anyone know how I can fix this? Thanks.
doseResponse(conc_nm_hed,resp_conc_hed)
xlabel('5HT Dose (nm)','FontSize',20)
ylabel('Normalized Response to Stimuli (\DeltaF / F)','FontSize',20)'
Warning: Rank deficient, rank = 3, tol = 1.196971e-11.
> In nlinfit>LMfit (line 587)
In nlinfit (line 284)
In doseResponse (line 47)
Warning: Rank deficient, rank = 1, tol = 3.802134e-12.
> In nlinfit>LMfit (line 587)
In nlinfit (line 284)
In doseResponse (line 47)
Warning: Some columns of the Jacobian are effectively zero at the solution, indicating that the model is insensitive to some of its parameters.
That may be because those parameters are not present in the model, or otherwise do not affect the predicted values. It may also be due to
numerical underflow in the model function, which can sometimes be avoided by choosing better initial parameter values, or by rescaling or
recentering. Parameter estimates may be unreliable.
> In nlinfit (line 381)
In doseResponse (line 47)
ans =
-5.2168e+07

답변 (1개)

Riya
Riya 2024년 1월 22일
Hello Aaron,
The warning message you are seeing indicates that the function `nlinfit` is encountering some issues while fitting the sigmoidal curve to your data. The warnings suggest that the matrix used in the fitting process is rank deficient, meaning that it does not have full rank.
To address this issue, you can try normalizing your data or applying a transformation to make it more suitable for fitting.
Here's an example of how you can normalize your response data before fitting the curve:
% Normalize the response data
normalized_resp = (resp_conc_hed - min(resp_conc_hed)) / (max(resp_conc_hed) - min(resp_conc_hed));
% Fit the sigmoidal curve using nlinfit
fit_params = nlinfit(conc_nm_hed, normalized_resp, @sigmoidal_function, initial_params);
% Plot the fitted curve
x = linspace(min(conc_nm_hed), max(conc_nm_hed), 100);
y_fit = sigmoidal_function(fit_params, x);
plot(conc_nm_hed, normalized_resp, 'o')
hold on
plot(x, y_fit)
xlabel('5HT Dose (nm)','FontSize',20)
ylabel('Normalized Response to Stimuli (\DeltaF / F)','FontSize',20)
legend('Data', 'Fitted Curve')
In this example, `sigmoidal_function` is a custom function that defines the sigmoidal curve model. You can replace it with your own function that represents the model you want to fit.
For more information you can refer following articles for more information:

카테고리

Help CenterFile Exchange에서 Curve Fitting Toolbox에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by