Problems with the three-parameter Weibull distribution

2 views (last 30 days)
Hi, I am working with the three-parameters Weibull distribution because my dataset contains only negative numbers. The code below is found in the documentation and obviously works correctly.
However, I don't fully understand how it works. I have searched on-line and in the documentation but I can't get around the two lines that I have highlighted in bold. I don't understand how to assign the values to the start vector and how to assign values to lower and upper bound. Any reference to the 'Weight' data would be helpful.
Thank you
Kind Regards
Federico
load carsmall
x = linspace(0,6000);
f_def = @(x,a,b,c) (x>c).*(b/a).*(((x-c)/a).^(b-1)).*exp(-((x-c)/a).^b);
try
mle(Weight,'pdf',f,'Start',[1700 2 1500])
catch ME
disp(ME)
end
opt = statset('FunValCheck','off');
params = mle(Weight,'pdf',f,'Start',[1700 2 1500],'Options',opt, ...
'LowerBound',[0 0 -Inf],'UpperBound',[Inf Inf min(Weight)])
figure
histogram(Weight,8,'Normalization','pdf')
hold on
plot(x,f(x,params(1),params(2),params(3)),'LineWidth',2)
hold off

Answers (1)

Federico Antonelli
Federico Antonelli on 10 Jan 2022
I have recently installed R2021b and the code given in the documentation works correctly. I have been able to find the parameters gamma, eta and beta without any problems.The software version was the issue.
Kind Regards
Federico

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!