fitting a skew distribution

조회 수: 7 (최근 30일)
Victor Lim
Victor Lim 2015년 5월 23일
댓글: Sanchit Sharma 2022년 3월 18일
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
Sanchit Sharma
Sanchit Sharma 2022년 3월 18일
Did you ever find a solution this this?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by