Fminsearch results shows shift from measured curve. How should I solve this?
2 views (last 30 days)
Show older comments
I am working with several measurement data which I am reading through matlab and then using Fminsearch to estimate through different model equations to fit with the measurement data. But fminsearch is giving a shift from the measured data as shown in picture. Blue one is the measured curve and orange one is the fminsearch estimation. How should I solve this? I am a beginner so would be helpful with some guidance. Thank you.
My sample of fminsearch:
4 Comments
Matt J
on 23 Jan 2023
As you can see above, the code doesn't run. SOme variables have not been specified.
Answers (1)
Matt J
on 23 Jan 2023
Edited: Matt J
on 23 Jan 2023
The x_Start=[1,1] selection looks very arbitrary. If one of the parameters is the oscillation amplitude, it should be closer to 0.4.
Other than that, though, there is too little information to diagnose. We would need to see the full code including the FitnessFunction (and as text, not a screenshot).
1 Comment
Matt J
on 23 Jan 2023
Edited: Matt J
on 23 Jan 2023
I notice that the least squares prediction F can be written as a linear combination of known things.
Q= abs(v) .* z ./ (Fc + (Fs - Fc) * exp(r));
zdot = v - sigma0*Q;
F = sigma0 * (z+zdot.*ts) + sigma1 * z_dot + sigma2.*v; % eq. 3
= sigma0*(z + v) - sigma0^2.*Q.*ts - sigma0*sigma1.*Q + (sigma1+sigma2)*v
= C1*(z + v) - C2.*Q.*ts - C3.*Q + C4*v
So, you can solve for C1 .. C4 by solving a set of linear equations.
Then, from the C coefficients, you can easily solve for sigma0 and sigma1.
Then, you can use that as an initial guess for the original optimization.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!