MLE program troubleshoot for the error "the pdf function returned negative or zero values"

3 views (last 30 days)
i have the following code and the error msg is
"Error using mlecustom>llf_pdfcdf (line 440)
The PDF function returned negative or zero values."
what is to be changed to get the lamda value?pls help me
X=[0;1;1;1;1;1;1;1;1;1;1]
Y=[0;0;3.16060256660987;4.32332341640756;4.75106456578097;4.90842176024353;4.96631024416752;4.98760622991804;4.99544058622424;4.99832268520062;4.99938295029261] t=[0:1:10]'
data=[X Y]
fn_mle=@(lamda, X, t) lamda(1)*(1-exp(-lamda(2).*t)).*X
phat=mle(data(:,2),'pdf',fn_mle,'start',[5 1],'lowerbound', [0.01 0.01], 'upperbound', [100 100]);

Answers (1)

sun
sun on 21 Jul 2021
Use the 'lowerbound' and 'upperbound'

Community Treasure Hunt

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

Start Hunting!