fitting a skew distribution

7 visualizaciones (últimos 30 días)
Victor Lim
Victor Lim el 23 de Mayo de 2015
Comentada: Sanchit Sharma el 18 de Mzo. de 2022
I generated some data using a function representing a skew distribution (contains an error function). I try to fit the function using a starting point of the same variables to generate the data but the fit comes out wrong. Not sure why it doesn't fit correctly. Here is the code:
x = (-10:.01:20)';
var = [2 10 6 -0.45 ];
y = var(1)*exp(-(x-var(2)).^2/(var(3)^2)).*(1+erf((x-var(2))*var(4)));
ftype=fittype('a*exp(-(x-b)^2/c^2)*(1+erf(x-b)*d)','coeff',{'a','b','c','d'})
f=fit(x(:),y(:),ftype,'startpoint',var)
plot(f,x,y)
  1 comentario
Sanchit Sharma
Sanchit Sharma el 18 de Mzo. de 2022
Did you ever find a solution this this?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by