How to generate random sample from a specific PDF?

18 ビュー (過去 30 日間)
Nguyen
Nguyen 2012 年 3 月 30 日
Hello, I've obtained a distribution of a random variable "kc". The PDF is in the form of two vectors (kc, phi_kc), so we don't have the explicit formula. Now I have to generate random sample from that PDF to re-inject into my system. I tried to search around but haven't found a good answer to my problem. I'll appriciate every help. Best regards.

採用された回答

the cyclist
the cyclist 2012 年 3 月 30 日
Is the phi_kc vector a discrete PDF, such that it specifies the probabilities of kc and sums to 1? If so, then if you have the Statistics Toolbox you can use the randsample() function to generate values from the distribution phi_kc. In particular, see the last example in "doc randsample", also available here: http://www.mathworks.com/help/toolbox/stats/randsample.html
If not, maybe you can give a bit more details about what phi_kc represents?
  1 件のコメント
Nguyen
Nguyen 2012 年 3 月 30 日
it's exactly what I'm searching for. Thank you for your help!

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

その他の回答 (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