Plotting normalised histogram of parameters

1 回表示 (過去 30 日間)
Prince Igweze
Prince Igweze 2019 年 12 月 4 日
回答済み: Navya Seelam 2019 年 12 月 9 日
How can I plot the normalized histograms for parameter x, which correspond to marginal probability distributions
n = 20000;
x = zeros(n,1);
x(1) = Mint(1);
for j = 1:n-1
x_c = normrnd(x(j),25);
if rand < min(1,normpdf(x_c)/normpdf(x(j)))
x(j+1) = x_c;
else
x(j+1) = x(j);
end
end
Thank you

回答 (1 件)

Navya Seelam
Navya Seelam 2019 年 12 月 9 日
Hi,
You can use histogram function to plot normalized histograms. To choose the type of normalization you can refer to Normalization section in this link

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by