I understand that rdrdtheta/pi is the probability that a random sample on the disk falls in the highlighted small area, but how should I interpret p(r,theta)drdtheta on the left?
motoole2
@yuanzhec The function p(r,\theta) represents the probability of a sample falling within an infinitesimally small region defined by dr and dtheta. If we are generating samples uniformly across the circle, the function p(r,\theta) should be r/\pi.
Febgreen
How do we decide p(r)? My thought is that for a given theta, the probability of points on the line is 1/2pir, and since we want to sample uniformly along the line, we want to make the probability a constant value. So it needs to be multiplied by r, and the coefficient 2 is added because the integral of p(r) must be 1. Is this logic correct?
motoole2
@Febgreen The process outlined on this slide is as follows.
1) Determine your parametrization for the circle. In this case, points on the circle are described in terms of a radius r and an angle theta (polar coordinates).
2) Compute the probability distribution function (PDF) for generating a sample with a given r and theta. In our case, we want to circle to be sampled uniformly, so the PDF should be proportional to the area for an infinitesimally small patch is p(r,theta) dr dtheta, defined by dr and dtheta. This gives us the definition p(r,theta) = r / pi.
3) Compute the cumulative PDF. In this case, the function p(r,theta) is separable into p(r)p(theta). So, we can compute the CDF of p(r) and p(theta) independently, producing P(r) = 2r and P(theta) = theta / (2pi)`.
4) Last, we solve the inverse of the cumulative PDFs, P(theta) = xi_1 and P(r) = xi_2, to generate random samples. This results in theta = 2pi xi_1 and r = sqrt(xi_2). Here, xi_1 and xi_2 are random variables sampled uniformly from [0,1].
I understand that rdrdtheta/pi is the probability that a random sample on the disk falls in the highlighted small area, but how should I interpret p(r,theta)drdtheta on the left?
@yuanzhec The function
p(r,\theta)
represents the probability of a sample falling within an infinitesimally small region defined bydr
anddtheta
. If we are generating samples uniformly across the circle, the functionp(r,\theta)
should ber/\pi
.How do we decide p(r)? My thought is that for a given theta, the probability of points on the line is 1/2pir, and since we want to sample uniformly along the line, we want to make the probability a constant value. So it needs to be multiplied by r, and the coefficient 2 is added because the integral of p(r) must be 1. Is this logic correct?
@Febgreen The process outlined on this slide is as follows.
1) Determine your parametrization for the circle. In this case, points on the circle are described in terms of a radius
r
and an angletheta
(polar coordinates).2) Compute the probability distribution function (PDF) for generating a sample with a given
r
andtheta
. In our case, we want to circle to be sampled uniformly, so the PDF should be proportional to the area for an infinitesimally small patch isp(r,theta) dr dtheta
, defined bydr
anddtheta
. This gives us the definitionp(r,theta) = r / pi
.3) Compute the cumulative PDF. In this case, the function
p(r,theta)
is separable intop(r)p(theta)
. So, we can compute the CDF ofp(r)
andp(theta)
independently, producingP(r) = 2r
and P(theta) = theta / (2pi)`.4) Last, we solve the inverse of the cumulative PDFs,
P(theta) = xi_1
andP(r) = xi_2
, to generate random samples. This results intheta = 2pi xi_1
andr = sqrt(xi_2)
. Here,xi_1
andxi_2
are random variables sampled uniformly from[0,1]
.