Generate a random number with specific probability density function
7 ビュー (過去 30 日間)
古いコメントを表示
I'm trying to generate a random number with a given PDF. I have the PDF stored as :
- X: with the possible values
- Y: with the density
plot(X,Y) displays the PDF
I've tried to use fitdist and makedist but I'm not able to convert it into a PDF object or anything usable.
Thanks you in advance
0 件のコメント
回答 (1 件)
Sean de Wolski
2015 年 4 月 7 日
slicesample will do this for you.
2 件のコメント
Torsten
2015 年 4 月 8 日
Given x, interpolate the density y(x) from your data vector Y.
This will give you a Kind of "function" y(x).
Best wishes
Torsten.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!