What are the signs that my parameter estimator is on the right track before convergence?

5 views (last 30 days)
I am doing parameter estimation using parameter estimator app
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 Comments
YASSER
YASSER on 13 May 2025
And why do you get NaN for experimental data ? Do the data you want to fit contain NaN values ?
-------------------------------------------------------------------
Dear Torsten : the Exp (Minimize) your asking about is the name Experiment (see photo)
because when openning the paramter estimator app you name your eperiment using your data and parameters to be estimated
The data is numbers for sure
I guess the problem is more deep and it depends on something like optimization or configuration
To conclude : i have tried the same experiment but with same reduced data and i havent face this issue

Sign in to comment.

Answers (1)

Sam Chak
Sam Chak on 13 May 2025
Edited: Sam Chak on 13 May 2025
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))
Output y(t) at time, t = 2000 NaN
% plot
plot(t, y), grid on
ylim([0, 2500])
xlabel('Time (seconds)'), ylabel('Amplitude')
  9 Comments
Torsten
Torsten on 14 May 2025
Edited: Torsten on 14 May 2025
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.

Sign in to comment.

Categories

Find more on Parameter Estimation in Help Center and File Exchange

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!