How to sample from a distribution?
조회 수: 129 (최근 30일)
Star Strider 2023년 1월 20일
‘How do you use randsample (or maybe something else?) to sample from a distribution?‘
The random function can be used with known distributions.
‘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.)