Cannot use MLE in Matlab for custom distribution with right censored data

19 views Asked by At

I have been trying to use the MLE function in Matlab to compute the parameters of a custom Weibull distribution, but I'm always getting errors such as my custom probability function returns negative or zero values. I have tried multiple variations of my approach, and finally gave up before asking for help here. The reliability function of my Weibull distribution has the following form: enter image description here

But in this case, my eta parameter has the following form:

enter image description here

Now, the V and T parameters are voltage and temperature respectively, and I have those. What I need is MLE to return the C, n, B, and beta parameters. The following is a minimally reproducible piece of code:

% constants
kB = 1.380649e-23;   % [J/K]
q  = 1.60217663e-19; % [C]

V = 50.0;
T = 125.0 + 273.15;

failureTimes = [238.1 916.5 935.7 991.0 1286.6 1372.3 1457.8 1521.0 1662.0 1710.0 1760.0 1797.0 1812.0 1818.0 1835.0 1850.0 ...
1863.0 1876.0 1890.0 1942.0 1997.0 2035.0 2086.0 2155.0 2198.0 2254.0 2297.0 2365.0 2401.0 2469.0 2524.0 2567.0 2609.0 ...
2689.0 2700.0 2705.0 2821.0 2878.0 2914.0 2990.0 3045.0 3098.0 3148.0 3199.0 3254.0 3300.0 3346.0 3407.0 3441.0 3451.0 ...
3506.5 3559.0 3602.0 3657.0 3706.0 3745.0 3799.0 3854.0 3867.0 3956.0 3957.0 3957.0 3957.0 3957.0 3957.0 3957.0 3957.0 ...
3957.0 3957.0 3957.0 3957.0 3957.0 3957.0 3957.0 3957.0 3957.0 3957.0 3957.0 3957.0 3957.0];
category = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1];

capsWeibull_pdf = @(data,c,n,B,b) ((V.^n)*exp(-B/T).*b/c)*((V.^n)*exp(-B/T).*data/c).^(b-1).*exp(-((V.^n)*exp(-B/T).*data/c).^b);
capsWeibull_cdf = @(data,c,n,B,b) 1 - exp(-((V.^n).*exp(-B/T).*data/c).^b);

phat = mle(failureTimes,'pdf',capsWeibull_pdf,'cdf',capsWeibull_cdf,'Start',[5,3,q*1.9/kB,3.5],'Censoring',category);

The pdf and cdf are taken from the standard Weibull distribution, but I use the custom eta function instead.

The failureTimes variable is self-explanatory, and category refers to actual (0) or right-censored (1) data.

I'd appreciate so much if someone could give a help here.

Many thanks in advance.

0

There are 0 answers