学长,关于单变量截断分布的抽样你可以参考下面的方法:
Algorithm 5.1: Probability integral transform method
5.1 Draw u from U(0, 1).
5.2 Return y = F−1(u) as a draw from f (y).
An important application of this method is to the problem of sampling from a
truncated distribution. Suppose that X has d.f. F(X) and that we wish to generate
values of X restricted to c1 ≤ X ≤ c2. The distribution of the truncated values is
[F(X) − F(c1)]/[F(c2) − F(c1)] for c1 ≤ X ≤ c2. Following our usual procedure,
we generate U ∼ U(0, 1) and set
U = (F(X) − F(c1))/(F(c2) − F(c1)),which implies that
X = F^-1(F(c1) + U[F(c2) − F(c1)]) (最后这个是反函数,因为懒得用公式编辑器了,呵呵)