Trucated Weibull distribution - parameter estimation?

8 views (last 30 days)
In order to fit a statistical distribution to a truncated set of data, MATLAB provides examples for poisson and normal distribution (see hyperlink_fitting_distributions).
Those work indeed fine, yet has fitting a truncated Weibull distribution proven to be trickier.
The numerical solution does not seem to converge, one gets either an error or the estimated parameters are simply the bounds provided by the user...
How does one fit a truncated Weibull distribution?
A minimum (not) working example with parameters bounded:
n= 150; % number of random points
a_0 = 0.045; % scaling parameter
b_0 = 0.8; % shape paramter - chosen random, but < 1
x = wblrnd(lambda,nu,n,1); % generate random data
x_trunc = 0.02; % truncation point
x = x(x > x_trunc); % truncate data
pdf_truncnorm = @(x,a,b) wblpdf(x,a,b)./(1-wblcdf(x,a,b)); % failure rate function for maximum likelihood
[paramest,paramCIs] = mle(x,'pdf',pdf_truncnorm,'start',[0.02,0.6],'LowerBound',[0 0],'UpperBound',[0.05 1]); % maximum likelihood estimation
% Error or wrong estimated parameters
The failure rate function tends to infinity for x approaching the truncation point - but this doesn't seem to be the issue.
Examples of fitted truncated Weibull distributions can be found in literature (e.g. see paper here) - what am I doing wrong?
Any help would be greatly appreciated!
  3 Comments
Jeff Miller
Jeff Miller on 26 Jan 2021
in the pdf_truncnorm line, shouldn't that be 1-wblcdf(x_trunc,a,b)?
Hobble Wobb
Hobble Wobb on 27 Jan 2021
Hello Jeff Miller,
thank you for your really quick reply! And thanks for the correction regarding x_trunc - of course you were right! I should have double checked that. Now it works perfectly fine.
I'm sorry about 'lambda' and 'nu', I changed nomenclature of the original script to comply with MATLAB nomenclature, but forgot about wblrnd.
For everyone reading this post later - corrected version:
n= 150; % number of random points
a_0 = 0.045; % scaling parameter
b_0 = 0.8; % shape paramter - chosen random, but < 1
x = wblrnd(a_0,b_0,n,1); % generate random data
x_trunc = 0.02; % truncation point
x = x(x > x_trunc); % truncate data
pdf_truncnorm = @(x,a,b) wblpdf(x,a,b)./(1-wblcdf(x_trunc,a,b)); % failure rate function for maximum likelihood
[paramest,paramCIs] = mle(x,'pdf',pdf_truncnorm,'start',[0.02,0.6],'LowerBound',[0 0]); % maximum likelihood estimation

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!