Parameter fitting problem: I use lsqnonlin to fit 3 parameters into a system of ODES and everything works fine until I inserted a Confidence Interval as one of my coefficients.At that point the fitted parameter vector took only the initial guess
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
helen flountzi
am 9 Nov. 2018
Beantwortet: george hargenrader
am 11 Nov. 2020
Parameter fitting problem: I use lsqnonlin to fit 3 parameters into a system of ODES and everything works fine until I inserted a Confidence Interval as one of my coefficients.At that point the fitted parameter vector took only the initial guess
2 Kommentare
Torsten
am 9 Nov. 2018
Bearbeitet: Torsten
am 9 Nov. 2018
Commented by Helen Flountzi:
For example, this is one of my ODEs: dy(1)=h*(1-z)*N-lamda0*nsp_r*y(1)-(m+q)*y(1)+param2*y(4); if I replace z with z=0.289+(0.615-0.289)*rand; my fitting process provides as solution the initial param2(0)that I gave initially(I already tried to change the initial values &still the same)
Akzeptierte Antwort
Torsten
am 9 Nov. 2018
Bearbeitet: Torsten
am 9 Nov. 2018
Each time your ODE function is called, "rand" takes a different value between 0 and 1. This makes it impossible for the ODE solver to get a solution of your ODE and for the fitting tool to determine optimal parameters. So it gives up and returns the initial guesses.
Call the fitting tool for different, but fixed values for z in a loop and see how the optimal parameters change.
Best wishes
Torsten.
4 Kommentare
Torsten
am 13 Nov. 2018
Bearbeitet: Torsten
am 13 Nov. 2018
Somewhere in your code you have to call "lsqnonlin". That's where you have to insert the above loop. This way, z_actual is passed to the function "fun_lsqnonlin" of lsqnonlin. In this function, you somehow have to call an ODE integrator (e.g. ODE45). Pass z_actual a second time to the function "fun_ODE_integrator" where you define your ODE in the same way as you did for lsqnonlin. Then you can use z_actual as coefficient in your ODE function.
Or, although usually not recommended: Define z_actual as global and insert
global z_actual
in the function where you call lsqnonlin and in the function where you supply the ODE.
Weitere Antworten (1)
george hargenrader
am 11 Nov. 2020
How does inserting a range of starting values for one parameter equate to a confidence interval? What information do you gain by doing this?
0 Kommentare
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!