Fit 2 parameters with fminsearch and use ODE15s to solve single differential equation
조회 수: 3 (최근 30일)
이전 댓글 표시
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 !!!
댓글 수: 1
Soomin Lee
2022년 6월 28일
How did you get p0 values which are educated guess of parameter y(1) and y(2)?
채택된 답변
Star Strider
2019년 12월 16일
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
Star Strider
2019년 12월 19일
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.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Computations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!