How to sample from a distribution?
133 次查看(过去 30 天)
显示 更早的评论
How do you use randsample (or maybe something else?) to sample from a distribution? Can you define a non-standard distribution as long as you have the formula for the pdf?
0 个评论
采纳的回答
Star Strider
2023-1-20
‘How do you use randsample (or maybe something else?) to sample from a distribution?‘
‘Can you define a non-standard distribution as long as you have the formula for the pdf?’
Yes. See Nonparametric and Empirical Probability Distributions for an extensive discussion. The ecdf function can be used to define an empirical distibution. (Getting random numbers from it would likely require inverting its pdf first, and that could be something of a challenge, depending on the distribution.)
.
4 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!