Section 4.11

Sampling from a distribution

[18/100%]
Show
LaTeX
Problem 4.11.1

If UU is uniformly distributed on [0,1][0,1], what is the distribution of X=⌊nU⌋+1X = \lfloor n U\rfloor +1?

?
Problem 4.11.2

Given the first nn integers in any sequence S0S_{0}, proceed thus:

(a) pick any position P0P_{0} from {1,2,…,n}\left\{ 1,2, \ldots , n\right\} at random, and swap the integer in that place of S0S_{0} with the integer in the nnth place of S0S_{0}, yielding S1S_{1}.

(b) pick any position P1P_{1} from {1,2,…,n−1}\left\{ 1,2, \ldots , n-1\right\} at random, and swap the integer in that place of S1S_{1} with the integer in the (n−1)(n-1) th place of S1S_{1}, yielding S2S_{2},

(c) at the (r−1)(r-1) th stage the integer in position Pr−1P_{r-1}, chosen randomly from {1,2,…,n−r+1}\left\{ 1,2, \ldots , n-r+1\right\}, is swapped with the integer at the (n−r+1)(n-r+1) th place of the sequence Sr−1S_{r-1}. Show that Sn−1S_{n-1} is equally likely to be any of the nn ! permutations of {1,2,…,n}\left\{ 1,2, \ldots , n\right\}.

?
Problem 4.11.3

Use the rejection method to sample from the gamma density Γ(λ,t)\Gamma (\lambda , t) where t(≥1)t( \geq 1) may not be assumed integral. [Hint: You might want to start with an exponential random variable with parameter 1/t1 / t.]

?
Problem 4.11.4

Show how to sample from the beta density β(α,β)\beta (\alpha , \beta ) where α,β≥1\alpha , \beta \geq 1. [Hint: Use Exercise (4.11.3).]

?
Problem 4.11.5

Describe three distinct methods of sampling from the density f(x)=6x(1−x),0≤x≤1f(x) = 6 x(1-x), 0 \leq x \leq 1.

?
Problem 4.11.6

A finite real vector is called a probability vector if it has non-negative entries with sum 1. Show that a probability vector p\mathbf{p} of length nn may be written in the form

p=1n−1∑r=1nvr \mathbf{p} = \frac{1}{n-1} \sum _{r = 1}^{n} \mathbf{v}_{r}

where each vr\mathbf{v}_{r} is a probability vector with at most two non-zero entries. Describe a method, based on this observation, for sampling from p\mathbf{p} viewed as a probability mass function.

?
Problem 4.11.7

Let U1U_{1} and U2U_{2} be independent and uniformly distributed on [0,1][0,1], and let Ti=2Ui−1T_{i} = 2 U_{i}-1. Show that, conditional on the event that R=T12+T22≤1R = \sqrt{T_{1}^{2}+T_{2}^{2}} \leq 1,

X=T1R−2log⁡R2,Y=T2R−2log⁡R2 X = \frac{T_{1}}{R} \sqrt{-2 \log R^{2}}, \quad Y = \frac{T_{2}}{R} \sqrt{-2 \log R^{2}}

are independent standard normal random variables.

?
Problem 4.11.8

Let UU be uniform on [0,1][0,1] and 0<q<10 < q < 1. Show that X=1+⌊log⁡U/log⁡q⌋X = 1+\lfloor \log U / \log q\rfloor has a geometric distribution.

?
Problem 4.11.9

A point (X,Y)(X, Y) is picked uniformly at random in the semicircle x2+y2≤1,x≥0x^{2}+y^{2} \leq 1, x \geq 0. What is the distribution of Z=Y/XZ = Y / X?

?
Problem 4.11.10

Let XX be a non-negative integer-valued random variable with h(r)=P(X=r∣X≥r)h(r) = \mathbb {P}\left(X = r \mid X \geq r\right). If {Ui:i≥0}\left\{ U_{i}: i \geq 0\right\} are independent and uniform on [0,1][0,1], show that Z=min⁡{n:Un≤h(n)}Z = \min \left\{ n : U_{n} \leq h(n)\right\} has the same distribution as XX.

?
Problem 4.11.11

Let g(x1,x2,…,xn)g\left(x_{1}, x_{2}, \ldots , x_{n}\right) be an increasing function in all its variables, and let {Ur:r≥1}\left\{ U_{r}: r \geq 1\right\} be independent and identically distributed random variables having the uniform distribution on [0,1][0,1]. Show that

cov⁡{g(U1,U2,…,Un),g(1−U1,1−U2,…,1−Un)}≤0 \operatorname {cov}\left\{ g\left(U_{1}, U_{2}, \ldots , U_{n}\right), g\left(1-U_{1}, 1-U_{2}, \ldots , 1-U_{n}\right)\right\} \leq 0

[Hint: Use the FKG inequality of Problem (3.11.18).] Explain how this can help in the efficient estimation of I=∫01g(x)dxI = \int_{0}^{1} g(\mathbf{x}) d \mathbf{x}.

?
Problem 4.11.12

We wish to estimate I=∫g(x)fX(x)dx=E[g(X)]I = \int g(x) f_{X}(x) d x = \mathbb {E}\left[g(X)\right], where either it is difficult to sample from the density fXf_{X}, or g(X)g(X) has a very large variance. Let fYf_{Y} be equivalent to fXf_{X}, which is to say that, for all x,fX(x)=0x, f_{X}(x) = 0 if and only if fY(x)=0f_{Y}(x) = 0. Let {Yi:0≤i≤n}\left\{ Y_{i}: 0 \leq i \leq n\right\} be independent random variables with density function fYf_{Y}, and define

J=1n∑r=1ng(Yr)fX(Yr)fY(Yr) J = \frac{1}{n} \sum _{r = 1}^{n} \frac{g\left(Y_{r}\right) f_{X}\left(Y_{r}\right)}{f_{Y}\left(Y_{r}\right)}

A technique invented by J. M. Hammersley and K. W. Morton in 1956.

Show that:

?
(a)

E[J]=I=E[g(Y)fX(Y)fY(Y)]\mathbb {E}\left[J\right] = I = \mathbb {E}\left[\frac{g(Y) f_{X}(Y)}{f_{Y}(Y)}\right],

(b)

Var⁡[J]=1n[E[g(Y)2fX(Y)2fY(Y)2]−I2]\operatorname {Var}\left[J\right] = \frac{1}{n}\left[\mathbb {E}\left[\frac{g(Y)^{2} f_{X}(Y)^{2}}{f_{Y}(Y)^{2}}\right]-I^{2}\right],

(c)

J→ a.s. IJ \xrightarrow {\text{ a.s. }} I as n→∞n \rightarrow \infty. (See Chapter 7 for an account of convergence.)

The idea here is that fYf_{Y} should be easy to sample from, and chosen if possible so that Var⁡[J]\operatorname {Var}\left[J\right] is much smaller than n−1[E[g(X)2]−I2]n^{-1}\left[\mathbb {E}\left[g(X)^{2}\right]-I^{2}\right]. The function fYf_{Y} is called the importance density.

Problem 4.11.13

Construct two distinct methods of sampling from the arc sine density function

f(x)=2π1−x2,0≤x≤1 f(x) = \frac{2}{\pi \sqrt{1-x^{2}}}, \quad 0 \leq x \leq 1
?
Problem 4.11.14

Let (X,Y)(X, Y) be a random point chosen uniformly on the unit disk. Show that

(U,V,W)=(2X1−X2−Y2,2Y1−X2−Y2,1−2(X2+Y2)) (U, V, W) = \left(2 X \sqrt{1-X^{2}-Y^{2}}, 2 Y \sqrt{1-X^{2}-Y^{2}}, 1-2\left(X^{2}+Y^{2}\right)\right)

is uniformly distributed on the unit sphere.

?
Problem 4.11.15

It is desired to sample from a density function fXf_{X} satisfying fX=f1+f2f_{X} = f_{1}+f_{2} where f1,f2:R→[0,∞)f_{1}, f_{2}: \mathbb {R} \rightarrow [0, \infty ), and f1≤fYf_{1} \leq f_{Y} for some random variable YY. Let UU be uniformly distributed on [0,1][0,1], and independent of YY. From YY and UU, we generate another random variable ZZ as follows. If U>f1(Y)/fY(Y)U > f_{1}(Y) / f_{Y}(Y), let ZZ have density f2(z)/∫−∞∞f2(u)duf_{2}(z) / \int_{-\infty }^{\infty } f_{2}(u) d u; otherwise set Z=YZ = Y. Show that ZZ has density function fXf_{X}.

?
Problem 4.11.16

The function F−1F^{-1} defined in Theorem (4.11.1) may be called the quantile function of the random variable in question.

?
(a)

For a random variable UU with the uniform distribution on (0,1)(0,1), and a continuously increasing function G:(0,1)→RG:(0,1) \rightarrow \mathbb {R}, show that the quantile function of G(U)G(U) is GG.

(b)

For a random variable XX with distribution function FF and density function ff, define HX(v)=E[F−1(U)∣U>v]H_{X}(v) = \mathbb {E}\left[F^{-1}(U) \mid U > v\right], where UU is as in part (a). The Hardy-Littlewood transform of XX is defined as HX(V)H_{X}(V), where VV is uniformly distributed on (0,1)(0,1) and independent of UU. Show that the quantile function of HX(V)H_{X}(V) is (1−v)−1∫v∞F−1(w)dw(1-v)^{-1} \int_{v}^{\infty } F^{-1}(w) d w, for v∈(0,1)v \in (0,1).

Problem 4.11.17

For an arbitrary (not necessarily continuous) distribution function F=FXF = F_{X}, define

G(x,u)=P(X<x)+uP(X=x)=F(x−)+u(F(x)−F(x−)),u∈[0,1] \begin{aligned} G(x, u) & = \mathbb {P}\left(X < x\right)+u \mathbb {P}\left(X = x\right) \\ & = F(x-)+u(F(x)-F(x-)), \quad u \in [0,1] \end{aligned}

Let UU be uniformly distributed on (0,1)(0,1) and independent of XX. We call G(X,U)G(X, U) the generalized distributional transform of XX. Show that W=G(X,U)W = G(X, U) is uniformly distributed on (0,1)(0,1), and that the random variable F−1(W)F^{-1}(W) has distribution function FF.

?
Problem 4.11.18

Let (X1,X2,…,Xn)\left(X_{1}, X_{2}, \ldots , X_{n}\right) be a random vector with joint distribution function FF and continuous marginal distribution functions F1,F2,…,FnF_{1}, F_{2}, \ldots , F_{n}. Show that there exists a 'copula-form' distribution function G(u1,u2,…,un)G\left(u_{1}, u_{2}, \ldots , u_{n}\right) such that F(x1,x2,…,xn)=G(F1(x1),F2(x2),…,Fn(xn))F\left(x_{1}, x_{2}, \ldots , x_{n}\right) = G\left(F_{1}\left(x_{1}\right), F_{2}\left(x_{2}\right), \ldots , F_{n}\left(x_{n}\right)\right). [A 'copula-form' distribution function is one with the property that all its marginals are uniform on [0,1][0,1]].

?