Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sigmoid curve fitting of data - is data appropriate? and which sigmoid function?

851 views
Skip to first unread message

Ana Tsifouti

unread,
Aug 23, 2011, 1:10:14 PM8/23/11
to
Hi,

I have the following data which I am trying to fit a sigmoid function.... but I am not sure if the sigmoid function is the best fit for these type data - also I dont know which sigmoid function to use.

x = [ 10 160 352 544 736 928 1120 1312 1504]
y = [0 0 0.66 0.66 0.58 0.66 0.83 0.66 0.75]

any help will be of much appreciation!

Ana

John D'Errico

unread,
Aug 23, 2011, 6:23:27 PM8/23/11
to
"Ana Tsifouti" wrote in message <j30mtm$hrq$1...@newscl01ah.mathworks.com>...

Are you serious? Asking WHICH sigmoid applies here
is an impossible question.

Your data is constant at one level, then between the
second and third points, it moves to a second level.
There is no shape in that transition to estimate the
parameters of any meaningful sigmoid function,
certainly not given the degree of noise in your data.

Perhaps you should consider the ultimate sigmoid
function - the Heaviside step function. Nothing more
is justified by your data.

John

John D'Errico

unread,
Aug 23, 2011, 6:24:26 PM8/23/11
to
"Ana Tsifouti" wrote in message <j30mtm$hrq$1...@newscl01ah.mathworks.com>...

Are you serious? Asking WHICH sigmoid applies here

Greg Heath

unread,
Aug 25, 2011, 8:42:11 PM8/25/11
to
On Aug 23, 1:10 pm, "Ana Tsifouti" <anastasoul...@hotmail.com> wrote:
> Hi,
>
> I have the following data which I am trying to fit a
> sigmoid function.... but I am not sure if the sigmoid
> function is the best fit for these type data - also I
> dont know which sigmoid function to use.
>
> x = [ 10 160 352 544 736 928 1120 1312 1504]
> y = [0 0 0.66 0.66 0.58 0.66 0.83 0.66 0.75]
>
> any help will be of much appreciation!
>
> Ana

clear all, close all, clc

x = [ 10 160 352 544 736 928 1120 1312 1504]

t = [ 0 0 0.66 0.66 0.58 0.66 0.83 0.66 0.75]
a = mean(t(t>0)) % 0.6857
y0 = a*(x-x(2))/(x(3)-x(2))
x0 = x(2) + (x(3)-x(2))*a/2 % 225.8286

% Logarithmic Sigmoid
% logsig is in the neural network toolbox
% logsig(x) = exp(-x)./(1+exp(-x))

y = a*logsig(x-x0)

figure
hold on
plot(x,t,'k')
plot(x(2:3),y0(2:3),'g')
plot(x,y,'r')

% Naive constant model

y00 = mean(t) % 0.5333
e00 = (t-y00)
MSE00 = mean(e00(:).^2) % 0.0856 Mean-Squared-Error

% Logsig Model

e = (t-y)
MSE = mean(e(:).^2) % 0.0043
R2 = 1-MSE/MSE00 % 0.9497 R^2 statistic

% Not bad. Now see if you can find an optimal b for
%
% y = a*logsig((x-x0)/b)
%
% Compare with a least-squares fit for [a x0 b]
%
% Hope this helps.
%
% Greg

Ana Tsifouti

unread,
Sep 5, 2011, 3:50:25 PM9/5/11
to
"John D'Errico" <wood...@rochester.rr.com> wrote in message <j319ap$kad$1...@newscl01ah.mathworks.com>...


Thank you John for your feedback! Heaviside step function is not appropriate for my data - the data are for a psychophysic curve...

Ana

0 new messages