# Problem in fitting a curve

1 view (last 30 days)
Tony Huang on 10 Dec 2019
Commented: Ridwan Alam on 12 Dec 2019
I use curve fitting tool to fit a curve as Weibull distribution. The equation is customized: y=b./a.*(x./a).^(b-1).*exp(-(x./a).^b). However, the result is always a straight line instead of a curve fitting the data I provided. Does anyone know the reason?
The data is as follows:
pDi x
1.91527908264147e-06 10000
2.52452408521644e-05 20000
0.000108023420014532 30000
0.000281361980293175 40000
0.000564617168528959 50000
0.000966958645210861 60000
0.00148973620601906 70000
0.00212867835554432 80000
0.00287571361483194 90000
0.00372040068782437 100000
0.00465101317626470 110000
0.00565533878273277 120000
0.00672125092045438 130000
0.00783710317358391 140000
0.00899198840247430 150000
0.0101758961405189 160000
0.0113797948618876 170000
0.0125956598248056 180000
0.0138164624331091 190000
0.0150361332620911 200000
0.0162495079029854 210000
0.0174522624447487 220000
0.0186408436024100 230000
0.0198123971096897 240000
0.0209646969310003 250000
0.0220960770427733 260000
0.0232053669292325 270000
0.0242918314879215 280000
0.0253551157100406 290000
0.0263951942618883 300000
0.0274123259247488 310000
0.0284070127344362 320000
0.0293799635852460 330000
0.0303320620161862 340000
0.0312643378721658 350000
0.0321779425234376 360000
0.0330741273283986 370000
0.0339542250343605 380000
0.0348196338256943 390000
0.0356718037465779 400000
0.0365122252453842 410000
0.0373424196081360 420000
0.0381639310689987 430000
0.0389783204056516 440000
0.0397871598465979 450000
0.0405920291353653 460000
0.0413945126135358 470000
0.0421961971999286 480000
0.0429986711577543 490000
0.0438035235544457 500000
0.0446123443309070 510000
0.0454267249075582 520000
0.0462482592643545 530000
0.0470785454406685 540000
0.0479191874088204 550000
0.0487717972820767 560000
0.0496379978243455 570000
0.0505194252344399 580000
0.0514177321828754 590000
0.0523345910838902 600000
0.0532716975893709 610000
0.0542307742952390 620000
0.0552135746541636 630000
0.0562218870916112 640000
0.0572575393251887 650000
0.0583224028894419 660000
0.0594183978715737 670000
0.0605474978646536 680000
0.0617117351481268 690000
0.0629132061069994 700000
0.0641540769031160 710000
0.0654365894138950 720000

#### 1 Comment

Ridwan Alam on 12 Dec 2019
Hi Tony, did you get an answer to the problem?

Ridwan Alam on 10 Dec 2019
Edited: Ridwan Alam on 10 Dec 2019
The problem is in your choise of equation. y is always calculated as zero. I think its because of the exponential component:
exp(-(x./a).^b) will always make the rest to zero for values of x in tens of thoudsands.
Unfortunately, Weibull is not a good model for this data, unless you perform some sort of scaling.

Tony Huang on 10 Dec 2019
So do you mean by changing the acceptable error may fix this error? Where can I do that? I tried to adjust the TolFun from the "Fit Option". But looks like didn't help.
Ridwan Alam on 10 Dec 2019
I don't think that's the case here. Because I tried to fit other functions, they fit just fine. It's just Weibull is not the right choice, maybe.
Ridwan Alam on 10 Dec 2019
So ... when change x with x/10000, I get this: