simulating probability density functions

6 ビュー (過去 30 日間)
Naga A
Naga A 2015 年 10 月 13 日
コメント済み: Naga A 2015 年 10 月 16 日
Hey everyone,
I derived the probability density function and cumulative distribution function formulas for the random variable "R" .I need to simulate them and compare them with my theoretical results.Can you give any suggestions how to simulate them.Thanks for the help
  2 件のコメント
James Tursa
James Tursa 2015 年 10 月 13 日
In what form do you have these functions? An equation or formula of some kind? Or just a vector of values? Your approach will depend on what you have to work with.
Naga A
Naga A 2015 年 10 月 16 日
The Cdf function looks like this:
F_R(r) = Pi*r^2 if 0 < r < sqrt(3)/2
= Pi*r^2 - 6*B_1 if sqrt(3)/2 < r < 1
= 1 if r > 1
I need to check the formula which I obtained theoretically is correct or not, by selecting some random value for "r" and find the value of cdf using the above functions.I'm thinking of algorithm like this:
for i=1:10,000
r= rand() % random number generator
F_x=find cdf
end
plot(r,F_x);
Am I right?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeRandom Number Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by