How to fix the upper asymptote in sigmoid?

7 ビュー (過去 30 日間)
Srilatha Raghavan
Srilatha Raghavan 2020 年 7 月 31 日
コメント済み: Srilatha Raghavan 2020 年 8 月 4 日
Hello, I have a sigmoid equation. My qestion is in a comment here:
The problem I am facing is, this sigmoid equation is a power curve and needs to reach a certain fixed height at the rated speed (variable 'a'). But I am not able to adjust my upper assymptode anything above 650, even by forcing my a to be an independent variable and also by replacing a by 900. Since, I am new to sigmoid, I would like some help to rewrite this piece of code to make my sigmoid reach 'a'. Also, I def need my xon, xoff and the everything about the curve from below to remain the same.
TIA
xon =3;
xrated = 12.5;
off=25;
a=900;
ft = fittype(@(b,c,x) mysigmoid(b,c,x,xon,xrated,a));
mdl = fit(x',y',ft,'start',[5 20]);
function yhat= mysigmoid(b,c,xon,xrated,a)
x= max(xon,min(x,xrated))
yhat = a./(1+exp(-(x-c)/b))- a./(1+exp(-(xon-c)/b));
end

採用された回答

Shae Morgan
Shae Morgan 2020 年 7 月 31 日
Your call to mysigmoid has 6 input arguments (b,c,x,xon,xrated,a; the last of which is your "a"), but your defined function only accepts 5 (b,c,xon,xrated,a). you're missing the 'x' input argument in your function definition.
This is likely leading to your issues with manually setting the "height" of the sigmoid function.
  4 件のコメント
Shae Morgan
Shae Morgan 2020 年 8 月 3 日
your code still doesn't run after reading in these X and Y values. Please provide a code that will run so it can be used.
ex. missing 'b', 'c', and 'x' values.
Srilatha Raghavan
Srilatha Raghavan 2020 年 8 月 4 日
I figured this out! If the data that is used to initialize the fit does not reach the required upper symptote, we cannot expect the model to do what want it to with our data. It was a basic understanding of the sigmoid and curve fitting toolbox. Anyways thank you.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpline Postprocessing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by