Azzera filtri
Azzera filtri

Fit 2 parameters with fminsearch and use ODE15s to solve single differential equation

2 visualizzazioni (ultimi 30 giorni)
Hello ! I am currently working on a project looking at tumor growth. I have to try different mathematical models from the litterature and fit them using some data.
For the momment I am trying to fit the Gompertz model of a tumor grotwh which is the following differential equation: (a-b*ln(v))*v)
In my code a is p(1) ; b is p(2) ; v is y(1).
I have made a first file to solve the differential equation.
Then I made a second file to fit the model with some data that I've got.
My code seems to work but I am getting estimated parameters very different from what I was expected which was around 1 or even less for a and b respectively. Also I shouldn't get a negative value.
I have tried to follow some previous examples of the MATLAB answers from Star Strider, so I am not at all sure about what I have done.
If someone could tell me if my code is correct It would be much appreciated. I have attached my 2 files.
Thanks in advance !!!

Risposta accettata

Star Strider
Star Strider il 16 Dic 2019
Using that model of the Gompertz equation, your code is correct.
If you want to avoid negative rate constants, use lsqcurvefit instead, with constraints on the lower limits of the parameters:
B = lsqcurvefit(@fit_GompModel, p0, t, y, [0 0])
producing:
B =
68.5834500164402
6.38601980323603e-12
This give a straight line, however that is likely the best you can do. I doubt that ga (genetic algorithm) or other solvers will produce any different result, although I did not try them.
  6 Commenti
hna
hna il 19 Dic 2019
Thanks again. Last question ..
I tried to code my model using fitnlm just to see the difference in terms of parameters with fminsearch but it dosn't seem to work... I have attached my file if you have time to get a quick look..
Also what is the most accurate in terms of paramters calculation between the 2 functions ?
Star Strider
Star Strider il 19 Dic 2019
I cannot get your model and data to work with fitnlm. I am not certain what the problem is, however it may be that there are too few data. It works with nlinfit, however the parameters are both negative, so the statistics would be irrelevant.

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by