How do I plot points in the region of a circle with radius 1, given a uniform bivariate distribution (X,Y)?
Conditional PDF of y given x is provided as: (1) / (2 * sqrt(1 - x^2))
Any help is greatly appreciated. (I am coding in Maple).
Thanks!
How do I plot points in the region of a circle with radius 1, given a uniform bivariate distribution (X,Y)?
Conditional PDF of y given x is provided as: (1) / (2 * sqrt(1 - x^2))
Any help is greatly appreciated. (I am coding in Maple).
Thanks!
I'm addressing the $\textit{first question}$: 'How do I plot points in this region ?'.
Generate a pair of 'random numbers' $\xi_{r}$ and $\xi_{t}$ which are uniformly distributed in $\left[0,1\right)$. A point$\left(x,y\right)$ in the unit disk is given by: $$ x = \sqrt{\xi_{r}}\cos\left(2\pi\xi_{t}\right)\,,\qquad y = \sqrt{\xi_{r}}\sin\left(2\pi\xi_{t}\right) $$
Clear[n,r,randDisk1,t];
randDisk1[] :=
Module[{r, t},
r = Sqrt[RandomReal[]];
t = 2 Pi RandomReal[];
{r Cos[t], r Sin[t]}
]
ListPlot[Table[randDisk1[], {n, 1, 10000}],
PlotStyle -> {Red, PointSize[0.002]}, Axes -> False,AspectRatio -> 1]