plot of log likelihood values

5 ビュー (過去 30 日間)
Ilias Minas
Ilias Minas 2021 年 11 月 9 日
回答済み: Jeff Miller 2021 年 11 月 10 日
Hi everyone,
I have the following data values [2 4 3 1 6 2 2.5 7 10] with two parameters :shape and scale.
I would like to plot the log likelihood values for the following shape values:
1 2 3 4 5 6 7 8 9 10
How can I do this on Matlab?
Yours sincerely
Ilias Minas
  2 件のコメント
Jeff Miller
Jeff Miller 2021 年 11 月 9 日
Do you want the scale value to be adjusted to maximize likelihood separately for each shape value?
Ilias Minas
Ilias Minas 2021 年 11 月 10 日
I want the scale value to be fixed at 6

サインインしてコメントする。

回答 (1 件)

Jeff Miller
Jeff Miller 2021 年 11 月 10 日
I think this might be what you are after:
x = [2 4 3 1 6 2 2.5 7 10]; % data
ShapeCandidates = 1:10;
Scale = 6;
loglikelihood = zeros(numel(ShapeCandidates),1);
for iShape=1:numel(ShapeCandidates)
wbl = makedist('Weibull','A',Scale,'B',iShape);
pdfs = wbl.pdf(x);
loglikelihood(iShape) = sum(log(pdfs));
end
figure; plot(ShapeCandidates,loglikelihood)
xlabel('Shape');
ylabel('Log likelihood');

Community Treasure Hunt

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

Start Hunting!

Translated by