未知の平均を持つ単変量正規分布をプロットするにはどうすればよいですか?平均値は平均と平均の分散平均?Matlab - 既知のパラメータで正規分布している未知の平均をプロットした正規分布
例: Nおよび(4、平均)law of total probabilityを使用して〜N(2,8)
未知の平均を持つ単変量正規分布をプロットするにはどうすればよいですか?平均値は平均と平均の分散平均?Matlab - 既知のパラメータで正規分布している未知の平均をプロットした正規分布
例: Nおよび(4、平均)law of total probabilityを使用して〜N(2,8)
を意味し、1だから
pdf(x) = int(pdf(x | mean) * pdf(mean) dmean)
を書くことができ、次のように、我々はMatlabの中でそれを計算することができます。
% define the constants
sigma_x = 4;
mu_mu = 2;
sigma_mu = 8;
% define the pdf of a normal distribution using the Symbolic Toolbox
% to be able to calculate the integral
syms x mu sigma
pdf(x, mu, sigma) = 1./sqrt(2*pi*sigma.^2) * exp(-(x-mu).^2/(2*sigma.^2));
% calculate the desired pdf
pdf_x(x) = int(pdf(x, mu, sigma_x) * pdf(mu, mu_mu, sigma_mu), mu, -Inf, Inf);
pdfCheck = int(pdf_x, x, -Inf, Inf) % should be one
% plot the desired pdf (green) and N(2, 4) as reference (red)
xs = -40:0.1:40;
figure
plot(xs, pdf(xs, mu_mu, sigma_x), 'r')
hold on
plot(xs, pdf_x(xs), 'g')
私は、計算されたpdfの積分が実際にはpdfであるために必要な条件である1に等しいことも確認しました。
緑のプロットは、要求されたPDFファイルです。赤のプロットは参照として追加され、一定の平均(平均平均に等しい)のpdfを表します。
ありがとうございます;私は3Dのrepresantationを取得しようとしていた。 – EKtee
平均、平均、卵、ベーコン、平均 –