【发布时间】:2022-01-21 08:08:10
【问题描述】:
这是我为生成两个随机变量的概率分布而编写的代码。现在我想绘制 JPD。
clear all;
clc;
x1 = randn(1000,1);
x2 = 10*randn(1000,1);
[count_1, b] = hist(x1, 25); %25 bins
pd1 = count_1 / length(x1) / (b(2) - b(1)); % probability distribution function of x1
[count_2, bn] = hist(x2, 25); %25 bins
pd2 = count_2 / length(x2) / (bn(2) - bn(1)); % probabitlity distribtuion function of x2
%subplot(2,2,1), plot(x,s1)
%subplot(2,2,2),plot(x,s2)
%subplot(2,2,1),plot(b,pd1)
%subplot(2,2,2),plot(bn,pd2)
我正在努力寻求帮助..请任何帮助..我已经尝试了一个多月 谢谢..
【问题讨论】:
-
在你的代码中没有叫 s1 和 s2。
-
计算联合概率分布,然后绘制它?基本上你只是分别计算 x1 的 pd 和 x2 的 pd ......
-
你是 matlab 的吗?就这么说吧
-
我回答假设您想要 matlab 并且没有 pdf 的关闭形式
标签: matlab math statistics probability bayesian