how to define N=100000 random variables in beta distribution
Lower bound L (%) 1.0
Upper bound U (%) 3.5
Coefficient a (alpha) 0.23
Coefficient b (beta) 0.33
and also after defining it how to plot and check.

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 5 月 3 日

1 投票

If you have Statistics and Machine Learning Toolbox, then you can use betarnd(): https://www.mathworks.com/help/releases/R2020a/stats/betarnd.html
a = 0.23;
b = 0.33;
x = betarnd(a, b, 1, 100000);
histogram(x, 'Normalization', 'pdf')

8 件のコメント

Saurabh Agarwal
Saurabh Agarwal 2020 年 5 月 4 日
what about lower and upper limi of function.
Ameer Hamza
Ameer Hamza 2020 年 5 月 4 日
Beta random numbers are distributed between 0 and 1, what is the meaning of lower and upper limits? Do you just want to shift the lower value to 1 and upper value to 3.5.
Saurabh Agarwal
Saurabh Agarwal 2020 年 5 月 4 日
yes
Saurabh Agarwal
Saurabh Agarwal 2020 年 5 月 4 日
i want to shift this whole distribution gets shift between lower value 1 and upper value 3.5
Saurabh Agarwal
Saurabh Agarwal 2020 年 5 月 4 日
limits exists at x axis
Saurabh Agarwal
Saurabh Agarwal 2020 年 5 月 4 日
Someting like this but for the values defined as above i question
Saurabh Agarwal
Saurabh Agarwal 2020 年 5 月 4 日
as you can see that horizontal axis is limited to 0.4 to 1.2 and whole distibution is defined in it.
Ameer Hamza
Ameer Hamza 2020 年 5 月 4 日
Try this.
a = 0.23;
b = 0.33;
l = 1;
u = 3.3;
x = rescale(betarnd(a, b, 1, 100000), l, u);
histogram(x, 'Normalization', 'pdf')

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeParallel Computing Toolbox についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by