matlab - sigm,sigm_fit - File Exchange - MATLAB Central

Optimization of parameters of the sigmoid function

Syntax:

[param]=sigm_fit(x,y)

that is the same that

[param]=sigm_fit(x,y,[],[],[]) % no fixed_params, automatic initial_params

[param]=sigm_fit(x,y,fixed_params) % automatic initial_params

[param]=sigm_fit(x,y,[],initial_params) % use it when the estimation is poor

[param]=sigm_fit(x,y,fixed_params,initial_params,plot_flag)

param = [min, max, x50, slope]

if fixed_params=[NaN, NaN , NaN , NaN] % or fixed_params=[]

optimization of "min", "max", "x50" and "slope" (default)

if fixed_params=[0, 1 , NaN , NaN]

optimization of x50 and slope of a sigmoid of ranging from 0 to 1

Additional information in the second output, STAT

[param,stat]=sigm_fit(x,y,fixed_params,initial_params,plot_flag)

Example:

%% generate data vectors (x and y)

fsigm = @(param,xval) param(1)+(param(2)-param(1))./(1+10.^((param(3)-xval)*param(4)))

param=[0 1 5 1]; % "min", "max", "x50", "slope"

x=0:0.1:10;

y=fsigm(param,x) + 0.1*randn(size(x));

%% standard parameter estimation

[estimated_params]=sigm_fit(x,y)

%% parameter estimation with forced 0.5 fixed min

[estimated_params]=sigm_fit(x,y,[0.5 NaN NaN NaN])

%% parameter estimation without plotting

[estimated_params]=sigm_fit(x,y,[],[],0)

Cite As

R P (2021). sigm_fit (https://www.mathworks.com/matlabcentral/fileexchange/42641-sigm_fit), MATLAB Central File Exchange.

Retrieved March 27, 2021.

Comments and Ratings (25)

Works perfectly and the instructions are clear.

14 Jul 2020

22 Aug 2019

17 Jun 2019

Great function!

26 Feb 2019

GDMFSOB Bloody brilliant! Thank you.

29 Jun 2018

16 May 2018

19 Feb 2018

Works right out of the box. Thanks!

1 Mar 2017

Works as expected!

Simple and effective. Similarly to polyfit-polyval, it would be great to include the related sigm_val function, to evaluate the generated sigmoidal curve.

5 Aug 2014

tried using the function with my data and the givven example but in both recieved "Undefined function 'sigm_fit' for input arguments of type

'double'."

any thughts about it?

4 Jun 2014

This requires a minmax() function - which toolbox is that in?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值