Probability Density Function
9 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I have a question please: If I have a funcion f(a,b,c,d), how can one assign a certain probability distribution function (e.g. normal distribution) for each of a,b,c,d? The second question is how to calculate the probability density function of f?
Thank you very much.
0 件のコメント
回答 (1 件)
Tom Lane
2012 年 5 月 10 日
This could be a very complicated question depending on how far you want to take it. Here's a simple attempt. You can simulate values of f by simulating values of its inputs. Then you can compute a histogram of the results. For example:
a = 10 + 2*randn(1000,1); % 1000 normal values, mean 10, std dev 2
b = pi*rand(1000,1); % 1000 values uniform between 0 and pi
f = @(a,b) a.*sin(b); % sample f function
e = f(a,b); % simulate f
hist(e,40); % histogram, similar to density function
This code doesn't make use of any toolbox, but you can find functions to generate random numbers from other distributions in the Statistics Toolbox.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!