求多个随机变量组合函数的概率密度函数?。
Show older comments
已知随机变量X1,X2均服从正态分布,利用matlab怎么画随机变量函数Y的概率密度图啊?
比如:x1~N(2.0,1.0^2),x2~N(4.0,0.5^2);
Y=714+807*(x1)+518*(x2)+325*(x1^2-1)+122*(x2^2-1)+360*x1*x2。
画随机变量函数Y的概率密度图,假设X1和X2相互独立;matlab只能通过仿真来模拟,而不是准确的概率密度函数。
具体程序是下边这样的。
x1=2+randn([100000,1]);
x2=4+randn([100000,1]);
Y=714+807*(x1)+518*(x2)+325*(x1.^2-1)+122*(x2.^2-1)+360*x1.*x2;
[f,y]=ksdensity(Y);
figure;
plot(y,f);
这么对吗?请前辈们帮我看看?谢谢啦!!!
Accepted Answer
More Answers (0)
Categories
Find more on gamma 分布 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!