how to solve the modified gompertz equation

44 views (last 30 days)
Hi guys, I have a set of data y and t, which is given below:
y=[10 12.5 15 17.5 20 22.5 25 27.5 30 32.5 35 37.5 40 42.5 45 47.5 50];
t=[62.1 77.3 92.5 104 112.9 121.9 125 129.4 134 138.2 142.3 143.2 144.6 147.2 147.8 149.1 150.9];
I'd like to have a curve fitting like ? = ? ??? (−???[((?*?)/?)(? −t)+1] and determine the constants of this equation (A,? and ?) . I am wandering if someone could help me with this. Thanks

Accepted Answer

Star Strider
Star Strider on 21 Oct 2018
Edited: Star Strider on 21 Oct 2018
Try this:
y=[10 12.5 15 17.5 20 22.5 25 27.5 30 32.5 35 37.5 40 42.5 45 47.5 50];
t=[62.1 77.3 92.5 104 112.9 121.9 125 129.4 134 138.2 142.3 143.2 144.6 147.2 147.8 149.1 150.9];
% % b(1) = A, B(2) = mu, b(3) = lambda
mgompertz = @(b,t) b(1) .* exp(-exp((b(2) .* exp(1))./b(1)) .* (b(3)-t) + 1);
[B,resnorm] = fminsearch(@(b) norm(y - mgompertz(b,t)), [1.4; -0.7; 37; 7])
figure
plot(t, y, 'p')
hold on
plot(t, mgompertz(B,t), '-r')
grid on
B =
0.719308092777122
-1.01103662495143
6.51690967061002
resnorm =
9.2295112377694
The plot appears to provide a decent fit.
EDIT Eliminated ‘b(4)’, replaced it with ‘exp(1)’.
  7 Comments
Mattana Pongsopon
Mattana Pongsopon on 2 May 2020
Star Strider,
Thank you so much for your response. It's of much help :)

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!