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

1 回表示 (過去 30 日間)
sreepradha
sreepradha 2016 年 2 月 17 日
回答済み: sun 2021 年 7 月 21 日
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]);

回答 (1 件)

sun
sun 2021 年 7 月 21 日
Use the 'lowerbound' and 'upperbound'

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by