What are the signs that my parameter estimator is on the right track before convergence?
3 次查看(过去 30 天)
显示 更早的评论

and the optimization is taking hours
but i have noticed as shown in photo attached that EXP (Minimize ) is not converging and Shows NAN , and i gues this is a bad sign
So How to evaluate parameter estimator performance mid-optimization?
7 个评论
Sam Chak
2025-5-12
If you attach the data here, someone will be able to check whether the data isNaN or not.
回答(1 个)
Sam Chak
2025-5-13
编辑:Sam Chak
2025-5-13
Hi @YASSER
In MATLAB, a 'NaN' result is primarily produced when there are indeterminate operations, such as Inf/Inf or 0/0. A secondary occurrence of NaN can result from operations involving NaN, such as 2*NaN or NaN^2. However, even if the data contain 'NaN', we can still plot the data. See the demo below.
Since you are certain that the data contains only numerical values, the third explanation for this occurrence is that extracting measured data from a spreadsheet with unmatched dimensions can also lead to 'NaN', specifically if empty cells are present. The time data comes from internal clock, and the measured data comes from the sensor.
If you have studied instrumentation and control before, you will know that 'no data' can sometimes happen due to malfunctioning sensors, momentary power outages, during hotline maintenance, or human error in data management. Typically, the device should indicate 'no data' at this timestamp.
Data in 'Book1' spreadsheet

Data loaded onto MATLAB

Plotting the data contain 'NaN'.
% time data
t = linspace(0, 4000, 4001);
% artificially inject a NaN at a specific indexed location
t(2001) = NaN;
% output data
y = 2300*exp(- ((t - 2000)/800).^2);
disp('Output y(t) at time, t = 2000'), disp(y(2001))
% plot
plot(t, y), grid on
ylim([0, 2500])
xlabel('Time (seconds)'), ylabel('Amplitude')
9 个评论
Torsten
2025-5-14
编辑:Torsten
2025-5-14
Getting NaN values in the course of your computation can have many reasons. Maybe your Simulink model gives back model values that are NaN for the parameters supplied by the fitting program. Or the fitting program itself approaches a set of NaN parameters.
I have no experience about coupling Simulink and normal MATLAB, but I guess that there should be a way to survey the parameter values and the model values during the optimization process.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Parameter Estimation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!