Finding the inflection point of a sigmoid function
32 ビュー (過去 30 日間)
表示 古いコメント
Hi, here's my function:
% define params
p1 = 0.0389;
p2 = 1.9158;
p3 = 162.4272;
p4 = 0.012;
% simulate the function
syms x
f = p1+(p2-p1)/(1+10^((p3-x)*p4));
fplot(f,[1 245])

Now, I would like to find the inflection point (I manually drew where I roughly expect it to be).
Here's what I was trying to do:
double(solve(f,'MaxDegree',3))
but I get this:
ans = 2.1394e+01 - 1.1370e+02i
Which means that there is no real inflection point... Where's my mistake?
Thanks in advance
Iddo
0 件のコメント
採用された回答
Star Strider
2017 年 12 月 18 日
Try this:
p1 = 0.0389;
p2 = 1.9158;
p3 = 162.4272;
p4 = 0.012;
% simulate the function
syms x
f(x) = p1+(p2-p1)/(1+10^((p3-x)*p4));
inflpt = vpasolve(diff(f,2) == 0); % Calculate Inflection Point
figure(1)
fplot(f,[1 245])
hold on
plot(inflpt, f(inflpt), 'pr', 'MarkerSize',10, 'MarkerFaceColor','g')
hold off
その他の回答 (1 件)
Roger Stafford
2017 年 12 月 18 日
編集済み: Roger Stafford
2017 年 12 月 18 日
The inflection point occurs at x = p3. You can show it by using the symbolic 'diff' to find the second derivative of f with respect to x and finding the x that makes it zero. That occurs when 10^((p3-x)*p4)) is equal to 1 which forces x to equal p3.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!